]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: store ticket.peer_global_id in connection
authorKefu Chai <kchai@redhat.com>
Sun, 30 Jun 2019 10:01:13 +0000 (18:01 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 2 Jul 2019 03:05:54 +0000 (11:05 +0800)
peer_global_id is used by `ProtocolV2::_handle_auth_request()` when
encoding an `AuthDoneFrame`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/common/auth_handler.h
src/crimson/mon/MonClient.cc
src/crimson/osd/osd.cc
src/crimson/osd/osd.h
src/test/crimson/test_monc.cc

index 521c75d0a42d13defcf04712c0d40e06482b0c63..922df6486dd1a10e78494ead60ccaa8a29f790d7 100644 (file)
@@ -11,7 +11,6 @@ class AuthHandler {
 public:
   // the peer just got authorized
   virtual void handle_authentication(const EntityName& name,
-                                    uint64_t global_id,
                                     const AuthCapsInfo& caps) = 0;
   virtual ~AuthHandler() = default;
 };
index 6bc976f51909e0fca4bd08e69fe12d76e1c91896..9660e639e934c0cae72d6a997428428dc0771f84 100644 (file)
@@ -600,7 +600,7 @@ int Client::handle_auth_request(ceph::net::ConnectionRef con,
     if (con->get_messenger()->get_require_authorizer()) {
       return -EACCES;
     } else {
-      auth_handler.handle_authentication({}, {}, {});
+      auth_handler.handle_authentication({}, {});
       return 1;
     }
   }
@@ -619,7 +619,6 @@ int Client::handle_auth_request(ceph::net::ConnectionRef con,
   ceph_assert(active_con);
   bool was_challenge = (bool)auth_meta->authorizer_challenge;
   EntityName name;
-  uint64_t global_id;
   AuthCapsInfo caps_info;
   bool is_valid = ah->verify_authorizer(
     &cct,
@@ -628,13 +627,13 @@ int Client::handle_auth_request(ceph::net::ConnectionRef con,
     auth_meta->get_connection_secret_length(),
     reply,
     &name,
-    &global_id,
+    &active_con->get_conn()->peer_global_id,
     &caps_info,
     &auth_meta->session_key,
     &auth_meta->connection_secret,
     &auth_meta->authorizer_challenge);
   if (is_valid) {
-    auth_handler.handle_authentication(name, global_id, caps_info);
+    auth_handler.handle_authentication(name, caps_info);
     return 1;
   }
   if (!more && !was_challenge && auth_meta->authorizer_challenge) {
index c76da4e3c49c6a3ca64381a70d73b90eca751fd5..5515ee35be7ceb195ee13da3803abf7722b8122f 100644 (file)
@@ -481,8 +481,7 @@ seastar::future<> OSD::ms_handle_remote_reset(ceph::net::ConnectionRef conn)
 }
 
 void OSD::handle_authentication(const EntityName& name,
-                                 uint64_t global_id,
-                                 const AuthCapsInfo& caps)
+                               const AuthCapsInfo& caps)
 {
   // todo
 }
index 7b55b6e311ba15927ed6c238bc71f2b0ea2383c7..1d12d70fbd24d33a80946c6e6a228768aa9dba7d 100644 (file)
@@ -105,7 +105,6 @@ class OSD final : public ceph::net::Dispatcher,
 
   // AuthHandler methods
   void handle_authentication(const EntityName& name,
-                            uint64_t global_id,
                             const AuthCapsInfo& caps) final;
 
   ceph::osd::ShardServices shard_services;
index fd43fb86ddc4ed8fae9a3c2c10feea436e607ee9..fc3984f81191b7b51edeb0e18ca92621139eb530 100644 (file)
@@ -14,7 +14,6 @@ namespace {
 class DummyAuthHandler : public ceph::common::AuthHandler {
 public:
   void handle_authentication(const EntityName& name,
-                             uint64_t global_id,
                              const AuthCapsInfo& caps) final
   {}
 };