Skip to content

Presigned-URL file transfer (API-key-only upload/download)#3

Merged
ryanntannn merged 1 commit into
masterfrom
presigned-urls
Jun 25, 2026
Merged

Presigned-URL file transfer (API-key-only upload/download)#3
ryanntannn merged 1 commit into
masterfrom
presigned-urls

Conversation

@ryanntannn

Copy link
Copy Markdown
Contributor

What

Researchers upload models/weather and download results with only their API key — no S3 credentials ever leave the cluster. The apiserver mints short-lived presigned URLs with its own credentials; the SDK PUTs/GETs them.

  • POST /v1/uploads → presigned PUT into the models/weather bucket + the ref to submit.
  • GET /v1/results/{id}/artifacts → presigned GETs, scoped to the caller's result (cross-user → 404, no leak).
  • SDK PresignedURLBackend (no boto3) is auto-selected when no S3 config is present; the direct-S3 backend is used when creds are given. submit_simulation/download_results behave identically on either.
  • URLs signed against S3_PUBLIC_ENDPOINT so they're reachable from the client; default expiry 300s (≤900s).

Why

Closes the static-credential / no-IRSA gap (researchers no longer need S3 keys on their laptops). Pairs with the EKS IRSA work — the apiserver mints URLs using its IRSA role.

Tests / QA

  • go build/vet/test clean; 16 Go handler tests + 8 SDK tests.
  • QA: 30/30 acceptance criteria PASS, 0 Critical/High/Medium (docs/QA-presigned.md). Security proven under attack: key-bound URLs (swap → 403), forced-expiry → 403, cross-user → 404, no client-side S3 creds, works without boto3.
  • Live end-to-end verified against the running stack with real EnergyPlus.

🤖 Generated with Claude Code

Researchers transfer files with only their API key — no S3 credentials ever leave
the cluster. The apiserver mints short-lived presigned URLs (signed against
S3_PUBLIC_ENDPOINT so they're client-reachable); the SDK PUTs/GETs them over plain HTTP.

- POST /v1/uploads → presigned PUT into models/weather + the ref to submit.
- GET /v1/results/{id}/artifacts → presigned GETs scoped to the caller's result.
- SDK PresignedURLBackend (no boto3) auto-selected when no S3 config is present;
  direct-S3 backend when creds are given. submit/download unchanged either way.

QA: 30/30 acceptance criteria pass, 0 Critical/High/Medium (docs/QA-presigned.md);
security verified (key-bound URLs, expiry, cross-user 404, no client creds).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019p51SPdbrjmGXJVeZnwTrD
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