]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
auth: move get_auth_client_handler() into AuthClientHandler
authorKefu Chai <kchai@redhat.com>
Wed, 15 Aug 2018 03:01:10 +0000 (11:01 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 16 Aug 2018 09:33:48 +0000 (17:33 +0800)
it's more intuitive if get_auth_client_handler() is a static method of
AuthClientHandler. and less repeating in the function name this way.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/auth/AuthClientHandler.cc
src/auth/AuthClientHandler.h
src/mon/MonClient.cc

index a76d1e4cc83c60e09e62afb1aa4d297bd7034414..8a75a30428930e7384f1cc9d92b3b04a62acdd8f 100644 (file)
@@ -19,8 +19,9 @@
 #include "cephx/CephxClientHandler.h"
 #include "none/AuthNoneClientHandler.h"
 
-AuthClientHandler *get_auth_client_handler(CephContext *cct, int proto,
-                                          RotatingKeyRing *rkeys)
+
+AuthClientHandler* AuthClientHandler::create(CephContext *cct, int proto,
+                                            RotatingKeyRing *rkeys)
 {
   switch (proto) {
   case CEPH_AUTH_CEPHX:
index 9b34550f9b23340004c7b8a018d1ddef064539b0..be1ad642bad6a7dcfaedfa1d4dd165cb2bce1e60 100644 (file)
@@ -60,13 +60,12 @@ public:
   virtual bool need_tickets() = 0;
 
   virtual void set_global_id(uint64_t id) = 0;
+
+  static AuthClientHandler* create(CephContext *cct,
+                                  int proto, RotatingKeyRing *rkeys);
 protected:
   virtual void validate_tickets() = 0;
 };
 
-
-extern AuthClientHandler *get_auth_client_handler(CephContext *cct,
-                                     int proto, RotatingKeyRing *rkeys);
-
 #endif
 
index 6bc91e18fdf8c0dc14f2d74582c8484c3b608452..bbbf0ab99e427e06ad1ca8d8bd659561407e068c 100644 (file)
@@ -1277,7 +1277,7 @@ int MonConnection::_negotiate(MAuthReply *m,
     return 0;
   }
 
-  auth.reset(get_auth_client_handler(cct, m->protocol, keyring));
+  auth.reset(AuthClientHandler::create(cct, m->protocol, keyring));
   if (!auth) {
     ldout(cct, 10) << "no handler for protocol " << m->protocol << dendl;
     if (m->result == -ENOTSUP) {