fix(storage): make openelements.storage.s3.region optional - #51
Merged
Merged
Conversation
The region belongs to the request signature, not to the address. SigV4 needs some string there, but only AWS derives meaning from it: on AWS it must match the bucket's region, while Hetzner Object Storage and other S3-compatible providers accept whatever is sent. Requiring it made those deployments configure a value nobody reads. It now defaults to us-east-1, the value such providers conventionally accept and ignore. Endpoint, bucket and credentials stay required. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Why
The region belongs to the request signature, not to the address. SigV4 needs some string there, but only AWS derives meaning from it — on AWS it must match the bucket's region, while Hetzner Object Storage and other S3-compatible providers accept whatever is sent and ignore it.
Requiring it made a Hetzner deployment configure a value nobody reads, and failed start-up over its absence.
What changes
openelements.storage.s3.regionis now optional, defaulting tous-east-1— the value S3-compatible providers conventionally accept and ignore. Endpoint, bucket and credentials stay required, and their absence still fails start-up naming the property.The default lives in
StorageProperties.S3.DEFAULT_REGIONand is applied by the binder via@DefaultValue, so the record component stays non-null andRegion.of(...)has nothing to guard against.Tests
Two added:
type=s3without a region starts and resolves to the default; a configured region survives. The incomplete-block test now expectsbucketrather thanregionas the first missing property — which is the behaviour change, stated as an assertion.93 tests in the module;
./mvnw -Pfull-build clean verify -Dmaven.javadoc.failOnWarnings=truegreen across all twelve.README and
docs/releases/upgrade-to-1.5.mdupdated, with the reason spelled out rather than just the flag flipped.🤖 Generated with Claude Code