Amazon S3: adopt the existing object store¶
Design authority: the AWS capability matrix and the research sources. Classified ADOPT.
The verdict¶
S3ObjectStorage is already an S3 adapter — it is verified against MinIO in this repository, which
is the same API — so using real S3 is a configuration change, not a code change: omit
endpoint_url and the AWS SDK resolves the regional endpoint itself.
What the adapter already gives you¶
- The full
ObjectStorageProvidercontract:put,get,metadata,stream,list,delete,health, with aSecurityContextin hand. - Tenant-prefixed keys.
tenant_prefix(tenant_id)andobject_key(tenant_id, path)are the only way keys are built, andlistscopes to the tenant's prefix, so one tenant'slistcannot see another's objects. - Streaming with a chunk size, so a large object is not held in memory.
The honest caveat about prefixes¶
A prefix is a convention, not an enforcement. The adapter builds tenant-scoped keys and lists within them; it does not stop a caller that constructs its own key, and it cannot stop another client with credentials for the bucket. Real isolation is an IAM and bucket-policy concern: give a tenant's workload credentials whose policy restricts it to its own prefix, and the convention becomes a control. This page says that plainly because "tenant-prefixed keys" is easy to read as "isolated".
What changes in a deployment¶
| Concern | What to do |
|---|---|
| Credentials | an IAM role for the workload, not static keys — the SDK's default chain picks it up |
| Encryption | SSE-S3 or SSE-KMS at the bucket; the adapter does not encrypt and should not pretend to |
| Public access | block it at the account and bucket level; an object store that can be made public by a policy mistake is a finding |
| Large uploads | presigned URLs, with the client uploading directly — which is also why an API Gateway payload limit is not a problem to solve in the API (see the edge page) |
| Versioning and lifecycle | bucket configuration, not application code |
What the library deliberately does not do¶
No bucket creation, no policy management, no presigned-URL generation in the provider contract. The first two are infrastructure as code; the third is an application concern with its own lifetime and audience, and adding it to the object-store protocol would widen a contract that currently means "read and write objects".
Testing¶
S3ObjectStorage is exercised against MinIO in the repository's infrastructure tests. A live S3
run is NOT RUN — AWS credentials unavailable.