You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(audit): warn when storage parser falls back to Custom for framework namespace (#24)
All four storage backends' AuditEventKind parsers ended with a Custom
catch-all that quietly wrapped any unknown event-kind string. For
genuinely user-defined custom events this is correct, but for the
framework-owned namespaces (auth.*, http.*, account.*, config.*) it
silently swallows version-skew bugs — a downstream emitter on a newer
acton-service writes a new kind, an older reader returns
Custom("auth.token.missing"), and any consumer matching on the typed
variant misses the event with no signal.
Factor the catch-all logic into pub(crate) helpers in
audit/storage/mod.rs:
- looks_like_framework_kind(s) — true for strings beginning with one of
the four framework-owned prefixes.
- parse_custom_kind(s) — strips the "custom." prefix (preserving the
prior round-trip behavior for user-defined kinds) and emits a
tracing::warn! when looks_like_framework_kind is true, naming the
exact stored string so operators can grep for it.
All four parser catch-alls route through parse_custom_kind. Add unit
tests covering both helpers across the framework-namespace, custom-
namespace, and bare-user-string cases.
Closes#20
0 commit comments