Repository navigation
ci(publish-verify): the fake registry rejects a wrong bearer token so a mis-passed token is seen red (#999) - #1015
Merged
Merged
Conversation
… a mis-passed token is seen red (#999) The offline fakes in scripts/check-registry-lookup.sh and scripts/check-publish-verify-control.sh accepted any Authorization value, so #999 (check_signature handed the proxy repo's tag list as the pull token) passed the harness green. Both fakes now accept only the token they issue (`fake` from /token or /v2/auth; `fake-token` in the control) and answer anything else with a 401. New check-registry-lookup case drives the verifier's step-5 proxy-pin signature path (HEAD's pin, cut-over placed just before its introducing commit): the fixed verifier passes 40/40 with three proxy signatures and no refused request; the same verifier with #999 re-injected is exit 2 on a 401. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gap
#1000 hot-fixed #999:
check_signatureinscripts/verify-published-artifacts.shstep 5 was handed the proxy repo's tag list where it takes the pull token. The offline harnesses never saw it because their fake registries accepted anyAuthorization: Bearer …value. A wrong token and the right one looked the same.The enforcement
scripts/check-registry-lookup.sh(thecurlfake): the fake now issues one token,fake, from the token endpoint (/tokenfor ghcr.io,/v2/authfor quay.io, unchanged). Every other request must carry exactlyAuthorization: Bearer fake. Anything else gets a 401 in the shape each call style reads:-wprints401,-freturns 22, otherwise anUNAUTHORIZEDbody. Each refusal is logged to$FAKE/unauthorized. This is what ghcr.io and quay.io do.scripts/check-publish-verify-control.sh(the function-level fake):registry_all_tags,registry_any_tag,registry_tag_exists,registry_manifest_digestandregistry_referrersaccept only thefake-tokenthatregistry_registry_tokenissues. Any other value gets401on stderr and rc 2.registry_any_tagandregistry_tag_existsnow pass the token through, which they previously dropped.docker-content-digest, so the pinned proxy index can resolve. Tag HEADs behave as before.feat/040-quay-cutover.The new case (check-registry-lookup, 30 → 31 cases)
It drives the verifier's step-5 proxy-pin signature path through the fake:
PROXY_SIGNING_CUTOVERset to the parent of the commit that introduced that pin. The pin is therefore always a post-cut-over, checked pin and is never skipped as history.PROXY_PIN_CHECK=1."$tok"→"$tags"at both proxycheck_signaturecalls, the exact reverse of publish-verify: pass the pull token, not the tag list, to the proxy-pin signature checks (#999) #1000) must exit 2 on a 401, withinconclusive: could not look up the signature tags of …aether-proxy@…. A mutation guard checks that both call sites were rewritten.Both halves sit in one case, so the case also fails if the fake ever stops checking the token.
Seen red: buggy verifier staged in place of the fixed one
The pre-#1000 file (
16a4958, the commit beforeb763e8a) cannot run against main's libraries at all. It predates #998, so it sourcesghcr-lib.shand readsGHCR_CHART_REPO_PREFIX. Staged literally, it fails every verifier case withGHCR_CHART_REPO_PREFIX: unbound variable, which is the wrong reason. So the staged buggy script is main's verifier with #1000's two-token diff reversed, the same two lines16a4958carries (check_signature "$PROXY_REPO" "$pin" "$tags" "proxy index"/… "$child" "$tags" "proxy child"):Bearer dev …is the tag list sent as the token, which is #999 exactly.Green: fixed verifier (this branch, rebased on
fea9dce)All 30 pre-existing cases and all 14 control cases stay green with the token enforced. ShellCheck (
--config=lint --@aspect_rules_lint//lint:fail_on_violation //scripts:scripts_shell) is clean, and shfmt (//:format) left the files unchanged.docs/runbook.mdgains one sentence on the control harness paragraph.Closes #999
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr