S3 attachment storage#1656
Merged
Merged
Conversation
…ests against real bucket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds S3-compatible object storage as a backend for attachment caching, as an alternative to local filesystem storage.
s3/package): implements PutObject (with automatic multipart upload for large files), GetObject, DeleteObjects, and ListObjectsV2 using AWS Signature V4 signing — no AWS SDK dependencyattachment/package): unifiedStorewith pluggable backend interface (fileBackend/s3Backend), shared size tracking, rate limiting, and background syncattachment-cache-diraccepts an S3 URL (s3://ACCESS_KEY:SECRET_KEY@BUCKET[/PREFIX]?region=REGION[&endpoint=ENDPOINT]), auto-detecting path-style addressing when a custom endpoint is setdocs/config.mdwith S3 configuration examples and cleanup behaviorS3 client features
Test plan
go test ./s3/...— S3 client unit tests (signing, URL construction, prefix handling) and integration tests (mock S3 server)go test ./attachment/...— attachment store tests for both file and S3 backendsgo test ./server/...— server tests passgo test ./util/...— LimitReader, CountingReader, and LimitWriter tests