Skip to content

Claude/s3 presigned links i0cvr#67

Open
elffjs wants to merge 6 commits intomainfrom
claude/s3-presigned-links-I0cvr
Open

Claude/s3 presigned links i0cvr#67
elffjs wants to merge 6 commits intomainfrom
claude/s3-presigned-links-I0cvr

Conversation

@elffjs
Copy link
Copy Markdown
Member

@elffjs elffjs commented Mar 31, 2026

No description provided.

claude and others added 6 commits March 30, 2026 10:58
Objects stored under the cloudevent/blobs/ key prefix are now served
via a short-lived presigned S3 GET URL (dataUrl field) instead of being
downloaded and embedded inline in the GraphQL response. This avoids
ballooning the JSON payload for large binary objects (e.g. scans).

- Add Presigner interface + PresignBlobURL method to eventrepo.Service
- Export BlobKeyPrefix constant ("cloudevent/blobs/")
- Add dataUrl: String field to GraphQL CloudEvent type
- Detect blob prefix in LatestCloudEvent / CloudEvents resolvers;
  skip GetObject and presign against the primary bucket instead
- Wire s3.NewPresignClient into both GraphQL and gRPC app paths
- Update eventrepo.New signature; pass nil in tests that don't need presigning
- Add MockPresigner to generated mock file

https://claude.ai/code/session_015ReeLGeCywJfYkkrrng5wU
Describe the field in terms of behavior (large files) rather than the
internal key prefix convention, which is an implementation detail that
may change.

https://claude.ai/code/session_015ReeLGeCywJfYkkrrng5wU
- pkg/eventrepo/presign_test.go: unit tests for PresignBlobURL covering
  correct bucket/key routing, 15-minute TTL, presigner error propagation,
  and nil-presigner guard
- internal/graph/blob_resolver_test.go: unit tests for the DataUrl resolver
  (nil wrapper, empty DataURL, populated DataURL) and a composite test that
  a blob wrapper returns nil for data/dataBase64 and a URL for dataUrl

https://claude.ai/code/session_015ReeLGeCywJfYkkrrng5wU
Blobs are stored in the parquet bucket, not the primary CloudEvent
bucket. Remove the bucket parameter from PresignBlobURL and have it
read s.parquetBucket directly — callers no longer need to know the
routing.

Also add ResponseContentType/ResponseContentDisposition overrides so
the presigned URL always forces application/octet-stream + attachment
regardless of stored S3 metadata, preventing browser rendering.

https://claude.ai/code/session_015ReeLGeCywJfYkkrrng5wU
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.

2 participants