Skip to content

fix(#207): attach source token to Sigstore bundle download#208

Merged
jcfischer merged 2 commits into
mainfrom
issue-207-bundle-download-auth
Jun 4, 2026
Merged

fix(#207): attach source token to Sigstore bundle download#208
jcfischer merged 2 commits into
mainfrom
issue-207-bundle-download-auth

Conversation

@jcfischer
Copy link
Copy Markdown
Contributor

Symptom

First fully-verifiable signed install (soma 0.8.5, post meta-factory#523 + arc#205):

SHA-256 verified
Registry signature verified (verified with mf-reg-2026-04)
Sigstore verification failed: bundle bundle not found or unreachable (HTTP 401)

Root cause

Registry GET /storage/bundle/:sha256 = requireAuth() ('same access level as tarball download'). arc fetched it anonymously per a stale DD-80 comment. Dead code path until the #303 identity hard-fail was removed — nobody had ever reached the bundle fetch with real data.

Fix

  • downloadSigstoreBundle(url, tempDir, source?): Authorization: Bearer when the source carries a token (same contract as downloadPackage); anonymous otherwise
  • redirect: 'manual' so a future cross-origin redirect fail-closes instead of forwarding the bearer (mirrors downloadPackage's stripping concern — the bundle route is same-origin today, no redirect handling needed)
  • orchestrator passes its existing source through

Tests

Token-attached + anonymous cases; old anonymous-enforcement test replaced with rationale. Suite 988/988, tsc clean.

Verification after merge

arc install @metafactory/soma → Sigstore bundle verified for the GH-Actions identity → install completes. Will post output on #207.

Fixes #207

🤖 Generated with Claude Code

…ked signed installs

The registry's GET /storage/bundle/:sha256 is requireAuth()'d ('same
access level as tarball download'), but downloadSigstoreBundle fetched
anonymously per a stale DD-80 assumption. Unreachable-in-practice until
the identity gap (#303 / meta-factory#523) was fixed — the first fully
verifiable signed install then died at the bundle fetch with HTTP 401.

- attach Authorization: Bearer <token> when the source has one (same
  contract as downloadPackage's tarball fetch); tokenless sources stay
  anonymous
- redirect: 'manual' fail-closes if the route ever starts redirecting
  to third-party storage, so the bearer can't silently forward
  cross-origin (mirrors downloadPackage's stripping concern)
- verifyPackageSigstore passes its existing source through

Tests: token attached when present; anonymous without source; old
anonymous-enforcement test replaced.

Fixes #207

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor Author

@jcfischer jcfischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeReview — CodeQuality + Security + Architecture

Clean, surgical fix. +41/−5 across two files. Root cause well-documented, tests cover both branches (token present, token absent), CI green.

Findings

  • Security model correct — bearer only attached when source?.token exists; redirect: "manual" fail-closes cross-origin forwarding (mirrors downloadPackage pattern)
  • Backward-compatiblesource? optional param, anonymous callers unaffected
  • Tests solid — token-attached + anonymous cases; old anonymous-enforcement test replaced with rationale

Nit (non-blocking)

Module-level doc comment (line 10) still says Anonymous bundle fetch (DD-80): no Authorization header — stale after this PR. The in-function doc comment is correct.

blockers=0 majors=0 nits=1 — recommend: approve

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jcfischer jcfischer merged commit fee360b into main Jun 4, 2026
3 checks passed
@jcfischer jcfischer deleted the issue-207-bundle-download-auth branch June 4, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sigstore bundle download omits Authorization — 401 blocks install of signed packages (DD-80 assumption wrong)

1 participant