You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Upload should use backend-provided S3 credentials, not user environment variables #13
Currently, nemar dataset upload requires users to have AWS credentials set in their environment:
AWS credentials not found in environment
Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables
This contradicts the planned architecture in .context/access_control.md, which states:
S3 Access: Presigned URLs - Time-limited uploads
Backend generates presigned PUT URLs for each file
CLI uploads files directly to S3 using presigned URLs
User never sees AWS credentials
Expected Behavior
Users should NOT need AWS credentials. The upload flow should be:
CLI sends file manifest to backend: POST /datasets
Backend validates user, creates repo, and returns temporary S3 credentials (scoped to the dataset prefix)
CLI uses these temporary credentials for the git annex copy --to operation
Credentials expire after upload session
Implementation Notes
Since we use git-annex S3 special remote (not direct HTTP uploads), presigned URLs won't work because git-annex manages its own chunking and bookkeeping. Instead:
Activity
neuromechanist commentedon Jan 16, 2026
Root Cause Analysis
The disconnect happened because two incompatible approaches were implemented independently:
Backend (followed
access_control.md)The backend generates presigned URLs for direct HTTP PUT:
CLI (followed
validated_workflows.md)The CLI uses git-annex S3 special remote with direct credentials:
Why These Are Incompatible
git-annex cannot use presigned URLs because:
.git/annex/location trackinginitremote/enableremotewhich require actual credentialsThe Disconnect
In
plan.md, Phase 5 states:This was implemented as-designed, but it contradicts the security architecture in
access_control.md:The Fix
The backend should return temporary AWS credentials (via STS AssumeRole) instead of presigned URLs:
The CLI can then use these temporary credentials for
git annex copy --to.Files That Need Changes
Backend:
backend/src/services/s3.ts- ReplacegenerateDatasetUploadUrlswithgenerateTemporaryCredentialsusing AWS STSbackend/src/routes/datasets.ts- Return credentials instead of presigned URLsCLI:
src/lib/api.ts- Addaws_credentialstoCreateDatasetResponseinterfacesrc/commands/dataset.ts- Use credentials from API response instead of env varssrc/lib/datalad.ts- RemovecheckAWSCredentials()from prerequisitesfix: use backend-provided AWS credentials for S3 upload