summaryrefslogtreecommitdiffstats
path: root/src/auth/AuthServer.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/auth/AuthServer.h
parentInitial commit. (diff)
downloadceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz
ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/auth/AuthServer.h')
-rw-r--r--src/auth/AuthServer.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/auth/AuthServer.h b/src/auth/AuthServer.h
new file mode 100644
index 00000000..e3bc8787
--- /dev/null
+++ b/src/auth/AuthServer.h
@@ -0,0 +1,59 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#pragma once
+
+#include "AuthRegistry.h"
+
+#include <vector>
+
+class CephContext;
+class Connection;
+
+class AuthServer {
+public:
+ AuthRegistry auth_registry;
+
+ AuthServer(CephContext *cct) : auth_registry(cct) {}
+ virtual ~AuthServer() {}
+
+ /// Get authentication methods and connection modes for the given peer type
+ virtual void get_supported_auth_methods(
+ int peer_type,
+ std::vector<uint32_t> *methods,
+ std::vector<uint32_t> *modes = nullptr) {
+ auth_registry.get_supported_methods(peer_type, methods, modes);
+ }
+
+ /// Get support connection modes for the given peer type and auth method
+ virtual void get_supported_con_modes(
+ int peer_type,
+ uint32_t auth_method,
+ std::vector<uint32_t> *modes) {
+ auth_registry.get_supported_modes(peer_type, auth_method, modes);
+ }
+
+ /// Get support connection modes for the given peer type and auth method
+ virtual uint32_t pick_con_mode(
+ int peer_type,
+ uint32_t auth_method,
+ const std::vector<uint32_t>& preferred_modes) {
+ return auth_registry.pick_mode(peer_type, auth_method, preferred_modes);
+ }
+
+ /// return an AuthAuthorizeHandler for the given peer type and auth method
+ AuthAuthorizeHandler *get_auth_authorize_handler(
+ int peer_type,
+ int auth_method) {
+ return auth_registry.get_handler(peer_type, auth_method);
+ }
+
+ /// Handle an authentication request on an incoming connection
+ virtual int handle_auth_request(
+ Connection *con,
+ AuthConnectionMeta *auth_meta,
+ bool more, ///< true if this is not the first part of the handshake
+ uint32_t auth_method,
+ const bufferlist& bl,
+ bufferlist *reply) = 0;
+};