feat: auto-enable path-style addressing when a custom endpoint is set #99

Merged
argoyle merged 1 commits from feat/path-style-for-custom-endpoint into main 2026-04-17 17:18:55 +00:00
Owner

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

  • New unit test TestS3ClientOptions_PathStyleTogglesOnCustomEndpoint covers the three relevant env-var states
  • go test ./... passes

🤖 Generated with Claude Code

## 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)
argoyle added 1 commit 2026-04-17 17:09:52 +00:00
feat: auto-enable path-style addressing when a custom endpoint is set
storage / vulnerabilities (pull_request) Successful in 1m39s
storage / test (pull_request) Successful in 1m40s
pre-commit / pre-commit (pull_request) Successful in 6m16s
5f6044a0c1
When AWS_ENDPOINT_URL_S3 or AWS_ENDPOINT_URL is set (typically because
the runtime is pointing at a local MinIO/S3-compatible endpoint),
enable path-style addressing on the S3 client. Without this
requests fail because MinIO doesn't 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, so no behaviour change there.

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

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
argoyle scheduled this pull request to auto merge when all checks succeed 2026-04-17 17:11:13 +00:00
argoyle merged commit 1620565ae6 into main 2026-04-17 17:18:54 +00:00
argoyle deleted branch feat/path-style-for-custom-endpoint 2026-04-17 17:18:56 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unboundsoftware/storage#99