]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/net: let conn directly verify the authorizer with dispatcher
authorYingxin <yingxin.cheng@intel.com>
Thu, 20 Dec 2018 19:30:02 +0000 (03:30 +0800)
committerYingxin <yingxin.cheng@intel.com>
Thu, 20 Dec 2018 19:42:42 +0000 (03:42 +0800)
Signed-off-by: Yingxin <yingxin.cheng@intel.com>
src/crimson/net/Messenger.h
src/crimson/net/SocketConnection.cc
src/crimson/net/SocketMessenger.cc
src/crimson/net/SocketMessenger.h

index fcdd5ad32a6e0a073532ddbea8f67b8ef5e71385..0d8484fd2c21b4539c5e5d4344ec748fe12af24c 100644 (file)
@@ -62,15 +62,6 @@ class Messenger {
     return ++global_seq;
   }
 
-  // @returns a tuple of <is_valid, auth_reply, session_key>
-  virtual seastar::future<msgr_tag_t,    /// tag for error, 0 if authorized
-                          bufferlist>    /// auth_reply
-  verify_authorizer(peer_type_t peer_type,
-                   auth_proto_t protocol,
-                   bufferlist& auth) = 0;
-  virtual seastar::future<std::unique_ptr<AuthAuthorizer>>
-  get_authorizer(peer_type_t peer_type,
-                bool force_new) = 0;
   uint32_t get_crc_flags() const {
     return crc_flags;
   }
index 6afd6b2d6b1573df09301341a098dd22fdf62058..ef8281d5a79adb7e7e059d7b6c4cf1ebdda9a6c1 100644 (file)
@@ -460,9 +460,9 @@ SocketConnection::repeat_handle_connect()
         return seastar::make_ready_future<msgr_tag_t, bufferlist>(
             CEPH_MSGR_TAG_FEATURES, bufferlist{});
       }
-      return messenger.verify_authorizer(peer_type,
-                                         h.connect.authorizer_protocol,
-                                         authorizer);
+      return dispatcher.ms_verify_authorizer(peer_type,
+                                             h.connect.authorizer_protocol,
+                                             authorizer);
     }).then([this] (ceph::net::msgr_tag_t tag, bufferlist&& authorizer_reply) {
       memset(&h.reply, 0, sizeof(h.reply));
       if (tag) {
@@ -642,7 +642,7 @@ SocketConnection::handle_connect_reply(msgr_tag_t tag)
     }
     h.got_bad_auth = true;
     // try harder
-    return messenger.get_authorizer(peer_type, true)
+    return dispatcher.ms_get_authorizer(peer_type, true)
       .then([this](auto&& auth) {
         h.authorizer = std::move(auth);
         return stop_t::no;
@@ -734,7 +734,7 @@ SocketConnection::repeat_connect()
   // this is fyi, actually, server decides!
   h.connect.flags = policy.lossy ? CEPH_MSG_CONNECT_LOSSY : 0;
 
-  return messenger.get_authorizer(peer_type, false)
+  return dispatcher.ms_get_authorizer(peer_type, false)
     .then([this](auto&& auth) {
       h.authorizer = std::move(auth);
       bufferlist bl;
index 3791463455d25c7a74ffedd7abfd1939a65cf7ef..75c2870f3f8cec47a5ff5236af7105adb5d4c5c5 100644 (file)
@@ -151,17 +151,3 @@ void SocketMessenger::unregister_conn(SocketConnectionRef conn)
   ceph_assert(found->second == conn);
   connections.erase(found);
 }
-
-seastar::future<msgr_tag_t, bufferlist>
-SocketMessenger::verify_authorizer(peer_type_t peer_type,
-                                  auth_proto_t protocol,
-                                  bufferlist& auth)
-{
-  return dispatcher->ms_verify_authorizer(peer_type, protocol, auth);
-}
-
-seastar::future<std::unique_ptr<AuthAuthorizer>>
-SocketMessenger::get_authorizer(peer_type_t peer_type, bool force_new)
-{
-  return dispatcher->ms_get_authorizer(peer_type, force_new);
-}
index 5977ba3a892f76123ceb83bad773e487ec1c1f5e..c348f5920b329cb5dc7882bad19193eb88bf9591 100644 (file)
@@ -52,15 +52,6 @@ class SocketMessenger final : public Messenger {
 
   seastar::future<> shutdown() override;
 
-  seastar::future<msgr_tag_t, bufferlist>
-  verify_authorizer(peer_type_t peer_type,
-                   auth_proto_t protocol,
-                   bufferlist& auth) override;
-
-  seastar::future<std::unique_ptr<AuthAuthorizer>>
-  get_authorizer(peer_type_t peer_type,
-                bool force_new) override;
-
  public:
   void set_default_policy(const SocketPolicy& p);
   void set_policy(entity_type_t peer_type, const SocketPolicy& p);