From: Kefu Chai Date: Mon, 4 Mar 2019 05:09:40 +0000 (+0800) Subject: crimson/mon: implement Dispatcher::ms_get_authorizer() X-Git-Tag: v15.0.0~191^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6596ecd1099cd8e81f2fd60a62d005ac659b97cb;p=ceph-ci.git crimson/mon: implement Dispatcher::ms_get_authorizer() we need this method for supporting cephx authentication Signed-off-by: Kefu Chai --- diff --git a/src/crimson/mon/MonClient.cc b/src/crimson/mon/MonClient.cc index 4b61270c271..dba89c9f512 100644 --- a/src/crimson/mon/MonClient.cc +++ b/src/crimson/mon/MonClient.cc @@ -58,7 +58,7 @@ public: uint32_t want_keys); seastar::future<> close(); bool is_my_peer(const entity_addr_t& addr) const; - + AuthAuthorizer* get_authorizer(peer_type_t peer) const; seastar::future<> renew_tickets(); ceph::net::ConnectionRef get_conn(); @@ -105,6 +105,15 @@ seastar::future<> Connection::renew_tickets() return seastar::now(); } +AuthAuthorizer* Connection::get_authorizer(peer_type_t peer) const +{ + if (auth) { + return auth->build_authorizer(peer); + } else { + return nullptr; + } +} + std::unique_ptr Connection::create_auth(Ref m, const EntityName& name, @@ -354,6 +363,16 @@ seastar::future<> Client::ms_handle_reset(ceph::net::ConnectionRef conn) } } +AuthAuthorizer* Client::ms_get_authorizer(peer_type_t peer) const +{ + if (active_con) { + return active_con->get_authorizer(peer); + } else { + return nullptr; + } +} + + seastar::future<> Client::handle_monmap(ceph::net::ConnectionRef conn, Ref m) { diff --git a/src/crimson/mon/MonClient.h b/src/crimson/mon/MonClient.h index ef9bcb69056..ffce5b06d19 100644 --- a/src/crimson/mon/MonClient.h +++ b/src/crimson/mon/MonClient.h @@ -90,6 +90,7 @@ private: seastar::future<> ms_dispatch(ceph::net::ConnectionRef conn, MessageRef m) override; seastar::future<> ms_handle_reset(ceph::net::ConnectionRef conn) override; + AuthAuthorizer* ms_get_authorizer(peer_type_t peer) const override; seastar::future<> handle_monmap(ceph::net::ConnectionRef conn, Ref m);