We're the only user, and no Dispatchers override.
Signed-off-by: Sage Weil <sage@redhat.com>
* @{
*/
- /**
- * Return the allowed authentication methods for peer
- **/
- virtual int ms_get_auth_allowed_methods(
- uint32_t peer_type, std::vector<uint32_t> &allowed_methods) {
- return 0;
- }
-
/**
* handle successful authentication (msgr2)
*
return bind(addrs.legacy_addr());
}
-void Messenger::ms_deliver_get_auth_allowed_methods(
- int peer_type, std::vector<uint32_t> &allowed_methods)
-{
- for (const auto &dispatcher : dispatchers) {
- if (dispatcher->ms_get_auth_allowed_methods(peer_type, allowed_methods))
- return;
- }
- if (allowed_methods.empty()) {
- if (get_mytype() == CEPH_ENTITY_TYPE_MON &&
- peer_type != CEPH_ENTITY_TYPE_MON) {
- allowed_methods.push_back(CEPH_AUTH_NONE);
- return;
- }
- std::string method;
- if (!cct->_conf->auth_supported.empty()) {
- method = cct->_conf->auth_supported;
- } else if (peer_type == CEPH_ENTITY_TYPE_OSD ||
- peer_type == CEPH_ENTITY_TYPE_MDS ||
- peer_type == CEPH_ENTITY_TYPE_MON ||
- peer_type == CEPH_ENTITY_TYPE_MGR) {
- method = cct->_conf->auth_cluster_required;
- } else {
- method = cct->_conf->auth_client_required;
- }
- AuthMethodList auth_list(cct, method);
- for (auto pt : auth_list.get_supported_set()) {
- allowed_methods.push_back(pt);
- }
- }
-}
-
bool Messenger::ms_deliver_verify_authorizer(
Connection *con,
int peer_type,
}
}
- /**
- * Get allowed authentication methods for a specific peer type
- **/
- void ms_deliver_get_auth_allowed_methods(
- int peer_type, std::vector<uint32_t> &allowed_methods);
-
/**
* Get the AuthAuthorizer for a new outgoing Connection.
*
struct DecryptionError : public std::exception {};
+void ProtocolV2::get_auth_allowed_methods(
+ int peer_type, std::vector<uint32_t> &allowed_methods)
+{
+ // FIXME: this is for legacy MAuth-based authentication
+ if (messenger->get_mytype() == CEPH_ENTITY_TYPE_MON &&
+ peer_type != CEPH_ENTITY_TYPE_MON) {
+ allowed_methods.push_back(CEPH_AUTH_NONE);
+ return;
+ }
+
+ std::string method;
+ if (!cct->_conf->auth_supported.empty()) {
+ method = cct->_conf->auth_supported;
+ } else if (peer_type == CEPH_ENTITY_TYPE_OSD ||
+ peer_type == CEPH_ENTITY_TYPE_MDS ||
+ peer_type == CEPH_ENTITY_TYPE_MON ||
+ peer_type == CEPH_ENTITY_TYPE_MGR) {
+ method = cct->_conf->auth_cluster_required;
+ } else {
+ method = cct->_conf->auth_client_required;
+ }
+ AuthMethodList auth_list(cct, method);
+ for (auto pt : auth_list.get_supported_set()) {
+ allowed_methods.push_back(pt);
+ }
+}
+
+
void ProtocolV2::run_continuation(CtPtr continuation) {
try {
CONTINUATION_RUN(continuation)
<< dendl;
std::vector<uint32_t> allowed_methods;
- messenger->ms_deliver_get_auth_allowed_methods(connection->peer_type,
- allowed_methods);
+ get_auth_allowed_methods(connection->peer_type,
+ allowed_methods);
bool found = std::find(allowed_methods.begin(), allowed_methods.end(),
auth_request.method()) != allowed_methods.end();
bool keepalive;
+ void get_auth_allowed_methods(
+ int peer_type, std::vector<uint32_t> &allowed_methods);
+
ostream &_conn_prefix(std::ostream *_dout);
void run_continuation(Ct<ProtocolV2> *continuation);
void calc_signature(const char *in, uint32_t length, char *out);