From: Kefu Chai Date: Wed, 15 Aug 2018 03:01:10 +0000 (+0800) Subject: auth: move get_auth_client_handler() into AuthClientHandler X-Git-Tag: v14.0.1~540^2~8 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4969f4a7b788965c9be10fd0c68bcc803ae6823d;p=ceph.git auth: move get_auth_client_handler() into AuthClientHandler 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 --- diff --git a/src/auth/AuthClientHandler.cc b/src/auth/AuthClientHandler.cc index a76d1e4cc83c6..8a75a30428930 100644 --- a/src/auth/AuthClientHandler.cc +++ b/src/auth/AuthClientHandler.cc @@ -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: diff --git a/src/auth/AuthClientHandler.h b/src/auth/AuthClientHandler.h index 9b34550f9b233..be1ad642bad6a 100644 --- a/src/auth/AuthClientHandler.h +++ b/src/auth/AuthClientHandler.h @@ -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 diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 6bc91e18fdf8c..bbbf0ab99e427 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -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) {