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
{{ message }}
Repository navigation
Commit 7898ef8
Browse filesBrowse the repository at this point in the historyBrowse files
test(cli): pin ALLOW_TOKEN_MAP against ALLOW_TOKENS in the drift guard
allow-tokens-pinned.test.ts covered ALLOW_TOKENS (the --allow validator) and
sdk's AllowTokenEnum, but not ALLOW_TOKEN_MAP (lib/allow.ts) — the structure
that actually grants a validated token's permission. A token present in
ALLOW_TOKENS but missing from the map would pass validation cleanly and
tokensToAllowOptions would silently grant nothing for it: --allow <token>
looks accepted but authorizes no destructive drop, and the diff blocks it
anyway with no indication the flag was ever a no-op. Same drift class that
left adopt-view broken in sdk's config schema since 0.20.4, but worse here
because there's no error to notice.
- cli/src/lib/allow.ts: export ALLOW_TOKEN_MAP (was module-local) so the
test can import the real structure instead of a hardcoded copy.
- allow-tokens-pinned.test.ts: two new assertions — ALLOW_TOKEN_MAP's key
set matches ALLOW_TOKENS in both directions, and its AllowOptions values
are unique (no two tokens silently grant the same permission).
Verified non-vacuous: removing an entry from ALLOW_TOKEN_MAP makes the new
assertion fail (confirmed with adopt-view specifically); restoring it goes
green again.
0 commit comments