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

Method new

nodedb/src/control/security/observability.rs:55–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53
54impl AuthMetrics {
55 pub fn new() -> Self {
56 Self {
57 jwt_validation_buckets: Default::default(),
58 rls_evaluation_buckets: Default::default(),
59 scope_resolution_buckets: Default::default(),
60
61 auth_success_password: AtomicU64::new(0),
62 auth_success_api_key: AtomicU64::new(0),
63 auth_success_jwt: AtomicU64::new(0),
64 auth_success_certificate: AtomicU64::new(0),
65 auth_success_trust: AtomicU64::new(0),
66
67 auth_failure_password: AtomicU64::new(0),
68 auth_failure_api_key: AtomicU64::new(0),
69 auth_failure_jwt: AtomicU64::new(0),
70 auth_failure_expired: AtomicU64::new(0),
71 auth_failure_blacklisted: AtomicU64::new(0),
72
73 rls_denied_total: AtomicU64::new(0),
74 blacklist_rejected_total: AtomicU64::new(0),
75 rate_limit_rejected_total: AtomicU64::new(0),
76
77 jwks_cache_hit_total: AtomicU64::new(0),
78 jwks_cache_miss_total: AtomicU64::new(0),
79 jwks_fetch_success_total: AtomicU64::new(0),
80 jwks_fetch_failure_total: AtomicU64::new(0),
81
82 failed_login_window: AtomicU64::new(0),
83 window_start_secs: AtomicU64::new(now_secs()),
84
85 jwks_circuit_open: std::sync::atomic::AtomicBool::new(false),
86 }
87 }
88
89 /// Record a duration in a histogram bucket array.
90 pub fn record_duration(buckets: &[AtomicU64; 7], start: Instant) {

Callers

nothing calls this directly

Calls 1

now_secsFunction · 0.70

Tested by

no test coverage detected