]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd/MonClient: Introduce Client::_wipe_secrets_and_tickets())
authorMatan Breizman <mbreizma@redhat.com>
Wed, 11 Jun 2025 09:38:59 +0000 (09:38 +0000)
committerPatrick Donnelly <pdonnell@ibm.com>
Wed, 1 Oct 2025 18:47:03 +0000 (14:47 -0400)
Similar to MonClient::_wipe_secrets_and_tickets())

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/crimson/mon/MonClient.cc
src/crimson/mon/MonClient.h

index e14f64815e182f3799f9c47dcf91c14d558abd73..eb527f07d8560109b1db97302b4c91eeb42a3f4e 100644 (file)
@@ -83,6 +83,7 @@ public:
   bool is_my_peer(const entity_addr_t& addr) const;
   AuthAuthorizer* get_authorizer(entity_type_t peer) const;
   KeyStore& get_keys();
+  void _wipe_secrets_and_tickets();
   seastar::future<> renew_tickets();
   seastar::future<> renew_rotating_keyring();
 
@@ -151,6 +152,12 @@ seastar::future<> Connection::renew_tickets()
   }
 }
 
+void Connection::_wipe_secrets_and_tickets() {
+  logger().info("{}: wiping rotating secrets and invalidating tickets", __func__);
+  rotating_keyring->wipe();
+  auth->invalidate_all_tickets();
+}
+
 seastar::future<> Connection::renew_rotating_keyring()
 {
   auto&& conf = crimson::common::local_conf();
@@ -950,6 +957,16 @@ seastar::future<> Client::authenticate()
   });
 }
 
+seastar::future<> Client::_wipe_secrets_and_tickets()
+{
+  logger().info("{} wiping rotating secrets and invalidating tickets", __func__);
+  if (active_con) {
+    active_con->_wipe_secrets_and_tickets();
+  }
+  return _check_auth_tickets();
+}
+
+
 seastar::future<> Client::stop()
 {
   logger().info("{}", __func__);
index c4424716a1726f2681df165271fb3394ce8bf483..2e86b803c79cc5b7524b4b26aaa306dbff5c8fce 100644 (file)
@@ -188,6 +188,8 @@ private:
   seastar::future<> load_keyring();
   seastar::future<> authenticate();
 
+  seastar::future<> _wipe_secrets_and_tickets();
+
   bool is_hunting() const;
   // @param rank, rank of the monitor to be connected, if it is less than 0,
   //              try to connect to all monitors in monmap, until one of them