Files
scadaproj/ZB.MOM.WW.Auth/tests
Joseph Doherty 2e52a02b85 feat(auth): batch API-key last-used writes off the request path (0.6.0, #61)
ApiKeyVerifier no longer awaits IApiKeyStore.MarkUsedAsync per verification.
A new ApiKeyUsageRecorder keeps key id -> latest use time in memory and a
background PeriodicTimer writes each key at most once per
ApiKeyOptions.LastUsedWriteIntervalSeconds (default 60; 0 = old inline write),
plus a final flush on dispose. ApiKeyVerifier is now IAsyncDisposable/IDisposable
and owned by the DI container. Failed stamps are counted (FailedWrites + meter
counter zb.auth.apikey.last_used.write_failures) and logged, never surfaced.

last_used_utc is now accurate to the interval. Version 0.6.0, unpublished.
Closes #61.
2026-12-05 01:10:31 -05:00
..