]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson: add Messenger::{set,get}_require_authorizer()
authorKefu Chai <kchai@redhat.com>
Thu, 18 Apr 2019 14:48:01 +0000 (22:48 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 28 Apr 2019 15:23:49 +0000 (23:23 +0800)
This flag is used for compatibility with pre-nautilus OSDs, which do not
send authorizers on the OSD heartbeat connections.  However, because the
AuthServer is implemented by MonClient, which is shared across all
OSD messengers, we can't set this to false for the OSD without disabling
all auth.  Instead, make it a Messenger property, and set it only on the
heartbeat server messengers.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/net/Messenger.h
src/test/crimson/test_monc.cc

index 76328f80119b7e88fd24e764aadf10630a722d89..c0e2602707ad759dc2e03f497527e7c054d55cc8 100644 (file)
@@ -39,8 +39,9 @@ class Messenger {
   uint32_t crc_flags = 0;
   ceph::auth::AuthClient* auth_client = nullptr;
   ceph::auth::AuthServer* auth_server = nullptr;
+  bool require_authorizer = true;
 
- public:
+public:
   Messenger(const entity_name_t& name)
     : my_name(name)
   {}
@@ -121,6 +122,14 @@ class Messenger {
 
   virtual void set_policy_throttler(entity_type_t peer_type, Throttle* throttle) = 0;
 
+  // allow unauthenticated connections.  This is needed for compatibility with
+  // pre-nautilus OSDs, which do not authenticate the heartbeat sessions.
+  bool get_require_authorizer() const {
+    return require_authorizer;
+  }
+  void set_require_authorizer(bool r) {
+    require_authorizer = r;
+  }
   static seastar::future<Messenger*>
   create(const entity_name_t& name,
          const std::string& lname,
index 742c34d59405a5c847584c204acb07d9e772b166..e7761c345ad47907f104a04c99726134f12e78dd 100644 (file)
@@ -15,7 +15,8 @@ class DummyAuthHandler : public ceph::common::AuthHandler {
 public:
   void handle_authentication(const EntityName& name,
                              uint64_t global_id,
-                             const AuthCapsInfo& caps) override {}
+                             const AuthCapsInfo& caps) final
+  {}
 };
 
 DummyAuthHandler dummy_handler;