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

Method list_for_user

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

List all keys for an auth user.

(&self, auth_user_id: &str)

Source from the content-addressed store, hash-verified

276
277 /// List all keys for an auth user.
278 pub fn list_for_user(&self, auth_user_id: &str) -> Vec<AuthApiKey> {
279 let now = now_secs();
280 let keys = self.keys.read().unwrap_or_else(|p| p.into_inner());
281 keys.values()
282 .filter(|k| k.auth_user_id == auth_user_id && k.is_valid(now))
283 .cloned()
284 .collect()
285 }
286
287 /// List all keys (admin view).
288 pub fn list_all(&self) -> Vec<AuthApiKey> {

Calls 4

collectMethod · 0.80
now_secsFunction · 0.70
readMethod · 0.45
is_validMethod · 0.45