pub struct ReloadHandle { /* private fields */ }Expand description
Handle for hot-reloading server configuration without restart.
Obtained via McpServerConfig::on_reload_ready.
All swap operations are lock-free and wait-free – in-flight requests
finish with the old values while new requests see the update immediately.
Implementations§
Source§impl ReloadHandle
impl ReloadHandle
Sourcepub fn try_reload_auth_keys(
&self,
keys: Vec<ApiKeyEntry>,
) -> Result<(), RmcpServerKitError>
pub fn try_reload_auth_keys( &self, keys: Vec<ApiKeyEntry>, ) -> Result<(), RmcpServerKitError>
Validate and atomically replace the API key list used by the auth middleware.
The new keys are validated before any swap: a blank key name is rejected because it would collapse distinct principals to one session-binding fingerprint (CWE-384). On error the previously installed keys stay in place. With no auth state configured this is a successful no-op.
This is the fallible counterpart to Self::reload_auth_keys; prefer
it so a rejected reload is observable rather than only logged.
§Errors
Returns RmcpServerKitError::Config naming the first blank-named
index; the currently installed key list is left untouched.
Sourcepub fn reload_auth_keys(&self, keys: Vec<ApiKeyEntry>)
pub fn reload_auth_keys(&self, keys: Vec<ApiKeyEntry>)
Atomically replace the API key list used by the auth middleware.
Compatibility wrapper over Self::try_reload_auth_keys. Invalid
input (a blank key name) is rejected, not installed: the error is
logged via tracing::error! and the previously installed keys are left
untouched, so a bad reload never silently swaps in
session-binding-colliding keys. Prefer Self::try_reload_auth_keys
to observe and handle the failure directly.
Sourcepub fn reload_rbac(&self, policy: RbacPolicy)
pub fn reload_rbac(&self, policy: RbacPolicy)
Atomically replace the RBAC policy used by the RBAC middleware.
Sourcepub async fn refresh_crls(&self) -> Result<(), RmcpServerKitError>
pub async fn refresh_crls(&self) -> Result<(), RmcpServerKitError>
Force an immediate refresh of all cached mTLS CRLs.
§Errors
Returns an error if CRL refresh is unavailable or verifier rebuild fails.