test(auth): date the deployed allowlist snapshot and assert per entry #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "test-deployed-allowlist-snapshot"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #7.
What changed
deployed_allowlist_parsesbecomes two tests:production_allowlist_snapshot_behaves— the snapshot, dated 2026-08-26,with the
kubectlcommand that reads the live value in the doc comment andan explicit statement that the test cannot detect drift. It asserts per entry
and exercises the matcher rather than counting.
allowlist_accepts_the_shapes_we_support— the parsing assertions, making noclaim about production.
The snapshot was re-read off the running pod's container env on 2026-08-26 and
is unchanged at nine entries, identical to the literal. Production runs
v0.1.2at
sha256:3d37a2eb….Verified by mutation, not by inspection
Two mutations, each run with the pre-repair count-only test restored alongside
under the name
mutation_control_old_deployed_allowlist_parsesso the two canbe compared on the same mutation.
1. Substitute one entry inside the snapshot literal, count unchanged at nine
(
cowork://oauth/callback→https://evil.example/callback, assertions leftuntouched):
That is the drift shape that mattered — a set that is the wrong set but still
the right size — and it is exactly what the old assertion could not see.
2. Break the matcher (
loopback_matches_ignoring_portreturnsfalseimmediately):
The first mutation I reached for was wrong and is worth recording: substituting
the entry everywhere in the file changed the assertion list along with the
literal, and the test stayed green. It has to be the literal alone.
What this still does not do
It cannot detect drift, and the doc comment says so in those words. The
deployment is not an input to a unit test, and the snapshot and the assertion
list are coupled by hand — editing both together stays green by construction.
What the test now pins is that the matcher behaves correctly against a shape
production really had, with a date saying how old that claim is.
Gates
cargo fmt --check,cargo clippy -D warnings,cargo test --all-features(101 passed),
cargo audit,cargo deny check bans licenses sources— allgreen locally on
rustc 1.98.0.