Files
storage/s3_test.go
T
argoyle 1620565ae6
Release / release (push) Successful in 52s
storage / test (push) Successful in 1m46s
storage / vulnerabilities (push) Successful in 1m46s
pre-commit / pre-commit (push) Successful in 6m26s
feat: auto-enable path-style addressing when a custom endpoint is set (#99)
## Summary

When `AWS_ENDPOINT_URL_S3` or `AWS_ENDPOINT_URL` is set — typically because the runtime is pointing at a local MinIO / S3-compatible endpoint — auto-enable path-style addressing on the S3 client. Without this, requests fail because MinIO does not implement virtual-hosted style addressing out of the box.

Production deployments leave those env vars unset and continue talking to real AWS S3 with virtual-hosted style — no behaviour change for prod.

Both `New()` and `NewS3()` share a `s3ClientOptions` helper that applies the toggle.

## Motivation

Spinning up a MinIO-backed acctest environment for Shiny (document-service, invoice-service, accounting-service). Without this change callers would have to sidestep `storage.New` and construct an `aws.Config` by hand just to flip `UsePathStyle`.

## Test plan

- [x] New unit test `TestS3ClientOptions_PathStyleTogglesOnCustomEndpoint` covers the three relevant env-var states
- [x] `go test ./...` passes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #99
2026-04-17 17:18:53 +00:00

13 KiB