1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
6 #include "AuthRegistry.h"
7 #include "include/common_fwd.h"
15 AuthRegistry auth_registry
;
17 AuthServer(CephContext
*cct
) : auth_registry(cct
) {}
18 virtual ~AuthServer() {}
20 /// Get authentication methods and connection modes for the given peer type
21 virtual void get_supported_auth_methods(
23 std::vector
<uint32_t> *methods
,
24 std::vector
<uint32_t> *modes
= nullptr) {
25 auth_registry
.get_supported_methods(peer_type
, methods
, modes
);
28 /// Get support connection modes for the given peer type and auth method
29 virtual void get_supported_con_modes(
32 std::vector
<uint32_t> *modes
) {
33 auth_registry
.get_supported_modes(peer_type
, auth_method
, modes
);
36 /// Get support connection modes for the given peer type and auth method
37 virtual uint32_t pick_con_mode(
40 const std::vector
<uint32_t>& preferred_modes
) {
41 return auth_registry
.pick_mode(peer_type
, auth_method
, preferred_modes
);
44 /// return an AuthAuthorizeHandler for the given peer type and auth method
45 AuthAuthorizeHandler
*get_auth_authorize_handler(
48 return auth_registry
.get_handler(peer_type
, auth_method
);
51 /// Handle an authentication request on an incoming connection
52 virtual int handle_auth_request(
54 AuthConnectionMeta
*auth_meta
,
55 bool more
, ///< true if this is not the first part of the handshake
57 const ceph::buffer::list
& bl
,
58 ceph::buffer::list
*reply
) = 0;