Skip to content

feat: add tenant-scoped artifact uploads - #63

Merged
Notyet1307 merged 1 commit into
mainfrom
feat/sas-201-artifact-upload
Sep 8, 2026
Merged

feat: add tenant-scoped artifact uploads#63
Notyet1307 merged 1 commit into
mainfrom
feat/sas-201-artifact-upload

Conversation

@Notyet1307

Copy link
Copy Markdown
Owner

Change

  • Add POST /v1/runs/{runID}/artifacts?name=... for bounded, streaming raw-byte uploads.
  • Compute SHA-256 and optionally verify X-Artifact-SHA256; validate media type, name, and non-empty size.
  • Atomically register metadata beside local Artifact bytes without embedding payloads in Run JSON.
  • List and download registered artifacts only after tenant-scoped Run authorization, while preserving legacy RunResult references.
  • Snapshot the agent-compose command context before Artifact persistence so completed processes are not reclassified as timeouts during post-processing.
  • Update OpenAPI, README, runbook, changelog, and project status.

Security boundaries

  • Authentication and tenant ownership are checked before request bytes are stored.
  • Cross-tenant upload, list, and download remain existence-hiding 404 responses.
  • SAS_MAX_BODY_BYTES is enforced with structured 413 artifact_too_large errors.
  • Stored paths remain Run-scoped; metadata is published atomically and symlink/non-regular downloads are rejected.
  • No arbitrary shell execution, Provider call, customer data, or live Sandbox action was added or performed.

Verification

  • make SAS_EXECUTOR=mock SAS_VERIFY_AGENT_COMPOSE=0 verify
  • make SAS_EXECUTOR=mock SAS_VERIFY_AGENT_COMPOSE=0 race
  • Actual Mock HTTP smoke: create 202, terminal succeeded, upload 201, list count 2, download 200, cross-tenant 404, oversized upload 413.

Non-goals

This local-file baseline does not claim chunked upload, presigned object storage, HA, encryption-at-rest, or lifecycle management. Those belong to the later object-storage phase.

Rollback

Stop new uploads, revert this PR, and retain SAS_ARTIFACT_DIR until the retention decision is complete. Older binaries ignore .metadata, so API-uploaded files remain on disk but are not listed or downloaded.

Closes #15

Comment thread internal/artifacts/store.go Fixed
Comment thread internal/artifacts/store.go Fixed
Comment thread internal/artifacts/store.go Fixed
Comment thread internal/artifacts/store.go Fixed
Comment thread internal/artifacts/store.go Fixed
Comment thread internal/artifacts/store.go Fixed
Comment thread internal/artifacts/store.go Fixed
@Notyet1307
Notyet1307 force-pushed the feat/sas-201-artifact-upload branch from 99fdd79 to 1192d2c Compare September 8, 2026 01:49
@Notyet1307
Notyet1307 merged commit 6ff3cca into main Sep 8, 2026
4 checks passed
@Notyet1307
Notyet1307 deleted the feat/sas-201-artifact-upload branch September 8, 2026 01:54
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.

[SAS-201] 实现 Artifact 上传登记与下载授权

2 participants