Skip to content

Add STS credential-based upload via AWS CLI #150

Closed

Description

@neuromechanist

Summary

Upload via presigned URLs tops out at ~15 MB/s even with 16 parallel streams, while the user's internet can do 40 MB/s. The per-connection HTTP overhead of individual PUT requests is the bottleneck.

Proposed Solution

Add an alternative upload path using AWS CLI (aws s3 sync) with STS temporary credentials:

  1. Backend endpoint: POST /datasets/:id/upload-credentials

    • Generates STS temporary credentials (1-2 hour expiry)
    • Admin/owner: scoped to PutObject on the full bucket
    • Regular users: scoped to PutObject on their dataset prefix only
    • Returns: { accessKeyId, secretAccessKey, sessionToken, region, bucket, prefix, expiresAt }
  2. CLI upload path:

    • Check if aws CLI is available
    • If available: request STS credentials, use aws s3 sync for data upload
    • If not available: fall back to presigned URL approach (adaptive batching)
    • Progress tracking still works via file manifest comparison
  3. Security:

    • STS credentials auto-expire (no permanent credential exposure)
    • Policy scoped to minimum required permissions (PutObject only)
    • Credentials travel over HTTPS, used only for the upload session

Why faster

aws s3 sync uses:

  • Connection pooling and HTTP/2
  • Multipart upload for large files (parallel parts)
  • Optimized transfer manager with bandwidth saturation
  • Built-in retry and resume logic

Implementation Notes

  • Backend uses aws4fetch for STS GetFederationToken (allows policy scoping)
  • CLI detects aws with which aws check
  • Existing presigned URL path remains as fallback
  • Progress tracking: compare S3 objects against manifest after sync

Activity

  1. added
    feature
    on Feb 14, 2026
  2. added 7 commits that reference this issue on Feb 14, 2026
    529bb5c
    2867314
    b67e215
    ef7c263
    f579e64
    a222a39
    30492ce
  3. neuromechanist commented on Feb 18, 2026

    @neuromechanist
    ContributorAuthor

    Shipped in v0.6.0 (PR #151)

  4. added a commit that references this issue on Feb 19, 2026
    52d9417
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions