From: Kefu Chai Date: Thu, 25 Apr 2019 05:48:04 +0000 (+0800) Subject: crimson: remove ms_get_authorizer() and friends X-Git-Tag: v15.1.0~2803^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5f61282e8e221b830cb903ef140503363cc2020d;p=ceph.git crimson: remove ms_get_authorizer() and friends Signed-off-by: Kefu Chai --- diff --git a/src/crimson/common/auth_service.h b/src/crimson/common/auth_service.h deleted file mode 100644 index 94c256dcba34..000000000000 --- a/src/crimson/common/auth_service.h +++ /dev/null @@ -1,16 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab - -#pragma once - -#include "crimson/net/Fwd.h" - -class AuthAuthorizer; - -namespace ceph::common { -class AuthService { -public: - virtual AuthAuthorizer* get_authorizer(peer_type_t peer) const = 0; - virtual ~AuthService() = default; -}; -} diff --git a/src/crimson/mon/MonClient.cc b/src/crimson/mon/MonClient.cc index 235b4a56c86f..de90d43da94c 100644 --- a/src/crimson/mon/MonClient.cc +++ b/src/crimson/mon/MonClient.cc @@ -481,20 +481,6 @@ 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; - } -} - -AuthAuthorizer* Client::get_authorizer(peer_type_t peer) const -{ - return ms_get_authorizer(peer); -} - std::pair, std::vector> Client::get_supported_auth_methods(int peer_type) { diff --git a/src/crimson/mon/MonClient.h b/src/crimson/mon/MonClient.h index 852494db3984..96fa3182c7ac 100644 --- a/src/crimson/mon/MonClient.h +++ b/src/crimson/mon/MonClient.h @@ -15,7 +15,6 @@ #include "crimson/auth/AuthClient.h" #include "crimson/auth/AuthServer.h" -#include "crimson/common/auth_service.h" #include "crimson/common/auth_handler.h" #include "crimson/net/Dispatcher.h" #include "crimson/net/Fwd.h" @@ -43,7 +42,6 @@ namespace ceph::mon { class Connection; class Client : public ceph::net::Dispatcher, - public ceph::common::AuthService, public ceph::auth::AuthClient, public ceph::auth::AuthServer { @@ -92,8 +90,6 @@ public: void sub_unwant(const std::string& what); bool sub_want_increment(const std::string& what, version_t start, unsigned flags); seastar::future<> renew_subs(); - // AuthService methods - AuthAuthorizer* get_authorizer(peer_type_t peer) const override; private: // AuthServer methods @@ -146,7 +142,6 @@ private: seastar::future<> ms_dispatch(ceph::net::Connection* 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::Connection* conn, Ref m); diff --git a/src/crimson/net/Dispatcher.h b/src/crimson/net/Dispatcher.h index 7a725e2fccff..8d6d9b71f927 100644 --- a/src/crimson/net/Dispatcher.h +++ b/src/crimson/net/Dispatcher.h @@ -53,9 +53,6 @@ class Dispatcher { bufferlist&) { return seastar::make_ready_future(0, bufferlist{}); } - virtual AuthAuthorizer* ms_get_authorizer(peer_type_t) const { - return nullptr; - } // get the local dispatcher shard if it is accessed by another core virtual Dispatcher* get_local_shard() { diff --git a/src/crimson/osd/chained_dispatchers.cc b/src/crimson/osd/chained_dispatchers.cc index 0473c8b00fe4..275e8678519b 100644 --- a/src/crimson/osd/chained_dispatchers.cc +++ b/src/crimson/osd/chained_dispatchers.cc @@ -37,17 +37,3 @@ ChainedDispatchers::ms_handle_remote_reset(ceph::net::ConnectionRef conn) { return dispatcher->ms_handle_remote_reset(conn); }); } - -AuthAuthorizer* -ChainedDispatchers::ms_get_authorizer(peer_type_t peer_type) const -{ - // since dispatcher returns a nullptr if it does not have the authorizer, - // let's use the chain-of-responsibility pattern here. - for (auto dispatcher : dispatchers) { - if (auto auth = dispatcher->ms_get_authorizer(peer_type); auth) { - return auth; - } - } - // just give up - return nullptr; -} diff --git a/src/crimson/osd/chained_dispatchers.h b/src/crimson/osd/chained_dispatchers.h index 1871e7416d04..4eda44f8111b 100644 --- a/src/crimson/osd/chained_dispatchers.h +++ b/src/crimson/osd/chained_dispatchers.h @@ -27,5 +27,4 @@ public: seastar::future<> ms_handle_connect(ceph::net::ConnectionRef conn) override; seastar::future<> ms_handle_reset(ceph::net::ConnectionRef conn) override; seastar::future<> ms_handle_remote_reset(ceph::net::ConnectionRef conn) override; - AuthAuthorizer* ms_get_authorizer(peer_type_t peer_type) const override; }; diff --git a/src/crimson/osd/heartbeat.cc b/src/crimson/osd/heartbeat.cc index f6c4e859e342..9d8b1bb640c5 100644 --- a/src/crimson/osd/heartbeat.cc +++ b/src/crimson/osd/heartbeat.cc @@ -5,7 +5,6 @@ #include "messages/MOSDPing.h" #include "messages/MOSDFailure.h" -#include "crimson/common/auth_service.h" #include "crimson/common/config_proxy.h" #include "crimson/net/Connection.h" #include "crimson/net/Messenger.h" @@ -304,11 +303,6 @@ seastar::future<> Heartbeat::handle_you_died() return seastar::now(); } -AuthAuthorizer* Heartbeat::ms_get_authorizer(peer_type_t peer) const -{ - return monc.get_authorizer(peer); -} - seastar::future<> Heartbeat::send_heartbeats() { using peers_item_t = typename peers_map_t::value_type; diff --git a/src/crimson/osd/heartbeat.h b/src/crimson/osd/heartbeat.h index 923e26157097..a066f144066f 100644 --- a/src/crimson/osd/heartbeat.h +++ b/src/crimson/osd/heartbeat.h @@ -47,7 +47,6 @@ public: seastar::future<> ms_dispatch(ceph::net::Connection* conn, MessageRef m) override; seastar::future<> ms_handle_reset(ceph::net::ConnectionRef conn) override; - AuthAuthorizer* ms_get_authorizer(peer_type_t peer) const override; private: seastar::future<> handle_osd_ping(ceph::net::Connection* conn, diff --git a/src/test/crimson/test_alien_echo.cc b/src/test/crimson/test_alien_echo.cc index 67a98c6dd3b8..5b98350ca1b1 100644 --- a/src/test/crimson/test_alien_echo.cc +++ b/src/test/crimson/test_alien_echo.cc @@ -58,10 +58,6 @@ struct Server { return seastar::make_ready_future( 0, bufferlist{}); } - std::unique_ptr authorizer = std::make_unique(); - AuthAuthorizer* ms_get_authorizer(peer_type_t) const override { - return authorizer.get(); - } } dispatcher; Server(ceph::net::Messenger& msgr) : byte_throttler(ceph::net::conf.osd_client_message_size_cap),