AuthClient methods -- for mon <-> mon communication
| 6353 | |
| 6354 | // AuthClient methods -- for mon <-> mon communication |
| 6355 | int Monitor::get_auth_request( |
| 6356 | Connection *con, |
| 6357 | AuthConnectionMeta *auth_meta, |
| 6358 | uint32_t *method, |
| 6359 | vector<uint32_t> *preferred_modes, |
| 6360 | bufferlist *out) |
| 6361 | { |
| 6362 | std::scoped_lock l(auth_lock); |
| 6363 | if (con->get_peer_type() != CEPH_ENTITY_TYPE_MON && |
| 6364 | con->get_peer_type() != CEPH_ENTITY_TYPE_MGR) { |
| 6365 | return -EACCES; |
| 6366 | } |
| 6367 | AuthAuthorizer *auth; |
| 6368 | if (!get_authorizer(con->get_peer_type(), &auth)) { |
| 6369 | return -EACCES; |
| 6370 | } |
| 6371 | auth_meta->authorizer.reset(auth); |
| 6372 | auth_registry.get_supported_modes(con->get_peer_type(), |
| 6373 | auth->protocol, |
| 6374 | preferred_modes); |
| 6375 | *method = auth->protocol; |
| 6376 | *out = auth->bl; |
| 6377 | return 0; |
| 6378 | } |
| 6379 | |
| 6380 | int Monitor::handle_auth_reply_more( |
| 6381 | Connection *con, |
no test coverage detected