From: Kefu Chai Date: Thu, 18 Apr 2019 14:48:01 +0000 (+0800) Subject: crimson: add Messenger::{set,get}_require_authorizer() X-Git-Tag: v15.1.0~2803^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=176db063be3d095340716fb0a2fd4ee64c2edf0b;p=ceph.git crimson: add Messenger::{set,get}_require_authorizer() 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 --- diff --git a/src/crimson/net/Messenger.h b/src/crimson/net/Messenger.h index 76328f80119b..c0e2602707ad 100644 --- a/src/crimson/net/Messenger.h +++ b/src/crimson/net/Messenger.h @@ -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 create(const entity_name_t& name, const std::string& lname, diff --git a/src/test/crimson/test_monc.cc b/src/test/crimson/test_monc.cc index 742c34d59405..e7761c345ad4 100644 --- a/src/test/crimson/test_monc.cc +++ b/src/test/crimson/test_monc.cc @@ -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;