Skip to content

fix(s3): unsigned manifest+summary reads with signed fallback (hotfix) - #570

Merged
neuromechanist merged 1 commit into
devfrom
hotfix/unsigned-manifest-read
May 22, 2026
Merged

neuromechanist merged 1 commit into
devfrom
hotfix/unsigned-manifest-read

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Hotfix already deployed to SCCN prod (version id f8145d89) — data.nemar.org was returning `{"error":"Version not published"}` for every dataset because the Worker's `AWS_ACCESS_KEY_ID` was disabled by AWS during the recent compromised-key incident, so the SigV4-signed S3 GETs in `getManifest` and `loadSummary` were all failing.

manifest.json and summary.json objects are uploaded public-read by the publication pipeline (data.nemar.org loads them on every page hit). There was never a reason to sign those GETs. Switching them to unsigned reads with a signed fallback restores read-only browsing immediately and survives future credential outages.

What changed

`backend/src/services/s3.ts`:

  • `getManifest()`: `fetch(url)` unsigned first; on 403, fall back to a SigV4-signed GET (for private / pre-publish datasets where the manifest isn't yet public-read)
  • `loadSummary()`: same pattern. 403 after fallback still throws (summary.json's 404 is briefly CDN-cached; want operator alerting on credentials drift)

No new dependencies. No interface changes. `createS3Client(options)` is now only invoked on the 403 fallback path, so missing/dead credentials don't crash the public happy path.

Test plan

Already verified live against SCCN prod:

Follow-up (not in this PR)

  • Restore Worker AWS write credentials with a dedicated Worker-only IAM user (was blocked by the AWSCompromisedKeyQuarantineV3 policy on the previous IAM user). Once those land, presigned per-file download URLs and federation-token uploads come back.
  • Cherry-pick this hotfix to main if main is deployed separately (in this project main and dev share the Worker via package.json version).

This branch was previously deployed

1 inactive deployment
npm — 054c4e0c Deployed May 22, 2026 by neuromechanist via publish #1038
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.

1 participant