const AuthRegistry& auth_registry;
ceph::net::ConnectionRef conn;
std::unique_ptr<AuthClientHandler> auth;
- RotatingKeyRing rotating_keyring;
+ std::unique_ptr<RotatingKeyRing> rotating_keyring;
uint64_t global_id;
clock_t::time_point last_rotating_renew_sent;
};
KeyRing* keyring)
: auth_registry{auth_registry},
conn{conn},
- rotating_keyring{nullptr, CEPH_ENTITY_TYPE_OSD, keyring}
+ rotating_keyring{
+ std::make_unique<RotatingKeyRing>(nullptr,
+ CEPH_ENTITY_TYPE_OSD,
+ keyring)}
{}
seastar::future<> Connection::handle_auth_reply(Ref<MAuthReply> m)
auto ttl = std::chrono::seconds{
static_cast<long>(ceph::common::local_conf()->auth_service_ticket_ttl)};
auto cutoff = now - ttl / 4;
- if (!rotating_keyring.need_new_secrets(utime_t(cutoff))) {
+ if (!rotating_keyring->need_new_secrets(utime_t(cutoff))) {
return seastar::now();
}
if (now - last_rotating_renew_sent < std::chrono::seconds{1}) {
}
KeyStore& Connection::get_keys() {
- return rotating_keyring;
+ return *rotating_keyring;
}
std::unique_ptr<AuthClientHandler>
std::unique_ptr<AuthClientHandler> auth;
auth.reset(AuthClientHandler::create(&cct,
protocol,
- &rotating_keyring));
+ rotating_keyring.get()));
if (!auth) {
logger().error("no handler for protocol {}", protocol);
throw std::system_error(make_error_code(