]> git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/auth/AuthServer.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / crimson / auth / AuthServer.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #pragma once
5
6 #include <cstdint>
7 #include <utility>
8 #include <vector>
9 #include "crimson/net/Fwd.h"
10
11 struct AuthAuthorizeHandler;
12
13 namespace crimson::auth {
14
15 class AuthServer {
16 public:
17 virtual ~AuthServer() {}
18
19 // Get authentication methods and connection modes for the given peer type
20 virtual std::pair<std::vector<uint32_t>, std::vector<uint32_t>>
21 get_supported_auth_methods(int peer_type) = 0;
22 // Get support connection modes for the given peer type and auth method
23 virtual uint32_t pick_con_mode(
24 int peer_type,
25 uint32_t auth_method,
26 const std::vector<uint32_t>& preferred_modes) = 0;
27 // return an AuthAuthorizeHandler for the given peer type and auth method
28 virtual AuthAuthorizeHandler* get_auth_authorize_handler(
29 int peer_type,
30 int auth_method) = 0;
31 // Handle an authentication request on an incoming connection
32 virtual int handle_auth_request(
33 crimson::net::ConnectionRef conn,
34 AuthConnectionMetaRef auth_meta,
35 bool more, //< true if this is not the first part of the handshake
36 uint32_t auth_method,
37 const bufferlist& bl,
38 bufferlist *reply) = 0;
39 };
40
41 } // namespace crimson::auth