]> git.proxmox.com Git - ceph.git/blob - ceph/src/auth/AuthClient.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / auth / AuthClient.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 <vector>
8 #include "include/buffer_fwd.h"
9
10 class AuthConnectionMeta;
11 class Connection;
12 class CryptoKey;
13
14 class AuthClient {
15 public:
16 virtual ~AuthClient() {}
17
18 /// Build an authentication request to begin the handshake
19 virtual int get_auth_request(
20 Connection *con,
21 AuthConnectionMeta *auth_meta,
22 uint32_t *method,
23 std::vector<uint32_t> *preferred_modes,
24 ceph::buffer::list *out) = 0;
25
26 /// Handle server's request to continue the handshake
27 virtual int handle_auth_reply_more(
28 Connection *con,
29 AuthConnectionMeta *auth_meta,
30 const ceph::buffer::list& bl,
31 ceph::buffer::list *reply) = 0;
32
33 /// Handle server's indication that authentication succeeded
34 virtual int handle_auth_done(
35 Connection *con,
36 AuthConnectionMeta *auth_meta,
37 uint64_t global_id,
38 uint32_t con_mode,
39 const ceph::buffer::list& bl,
40 CryptoKey *session_key,
41 std::string *connection_secret) = 0;
42
43 /// Handle server's indication that the previous auth attempt failed
44 virtual int handle_auth_bad_method(
45 Connection *con,
46 AuthConnectionMeta *auth_meta,
47 uint32_t old_auth_method,
48 int result,
49 const std::vector<uint32_t>& allowed_methods,
50 const std::vector<uint32_t>& allowed_modes) = 0;
51 };