MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / revoke

Method revoke

nodedb/src/control/security/auth_apikey.rs:210–218  ·  view source on GitHub ↗

Revoke a key.

(&self, key_id: &str)

Source from the content-addressed store, hash-verified

208
209 /// Revoke a key.
210 pub fn revoke(&self, key_id: &str) -> bool {
211 let mut keys = self.keys.write().unwrap_or_else(|p| p.into_inner());
212 if let Some(key) = keys.get_mut(key_id) {
213 key.is_revoked = true;
214 true
215 } else {
216 false
217 }
218 }
219
220 /// Rotate a key: create a new key that replaces the old one.
221 /// Both are valid during the overlap period.

Callers 2

revoked_key_rejectedFunction · 0.45
revoke_scopeFunction · 0.45

Calls 2

writeMethod · 0.45
get_mutMethod · 0.45

Tested by 1

revoked_key_rejectedFunction · 0.36