]> git.proxmox.com Git - ceph.git/blame - ceph/src/auth/DummyAuth.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / auth / DummyAuth.h
CommitLineData
11fdf7f2
TL
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3
4#include "AuthClient.h"
5#include "AuthServer.h"
6
7class DummyAuthClientServer : public AuthClient,
8 public AuthServer {
9public:
10 DummyAuthClientServer(CephContext *cct) : AuthServer(cct) {}
11
12 // client
13 int get_auth_request(
14 Connection *con,
15 AuthConnectionMeta *auth_meta,
16 uint32_t *method,
17 std::vector<uint32_t> *preferred_modes,
18 bufferlist *out) override {
19 *method = CEPH_AUTH_NONE;
20 *preferred_modes = { CEPH_CON_MODE_CRC };
21 return 0;
22 }
23
24 int handle_auth_reply_more(
25 Connection *con,
26 AuthConnectionMeta *auth_meta,
27 const bufferlist& bl,
28 bufferlist *reply) override {
29 ceph_abort();
30 }
31
32 int handle_auth_done(
33 Connection *con,
34 AuthConnectionMeta *auth_meta,
35 uint64_t global_id,
36 uint32_t con_mode,
37 const bufferlist& bl,
38 CryptoKey *session_key,
39 std::string *connection_secret) {
40 return 0;
41 }
42
43 int handle_auth_bad_method(
44 Connection *con,
45 AuthConnectionMeta *auth_meta,
46 uint32_t old_auth_method,
47 int result,
48 const std::vector<uint32_t>& allowed_methods,
49 const std::vector<uint32_t>& allowed_modes) override {
50 ceph_abort();
51 }
52
53 // server
54 int handle_auth_request(
55 Connection *con,
56 AuthConnectionMeta *auth_meta,
57 bool more,
58 uint32_t auth_method,
59 const bufferlist& bl,
60 bufferlist *reply) override {
61 return 1;
62 }
63};