HDDS-14386. Support bucket CORS configuration#10138
Open
ivandika3 wants to merge 19 commits intoapache:masterfrom
Open
HDDS-14386. Support bucket CORS configuration#10138ivandika3 wants to merge 19 commits intoapache:masterfrom
ivandika3 wants to merge 19 commits intoapache:masterfrom
Conversation
peterxcli
reviewed
May 1, 2026
| return corsConfiguration != null; | ||
| } | ||
|
|
||
| public boolean shouldClearCorsConfiguration() { |
Member
There was a problem hiding this comment.
nit
Suggested change
| public boolean shouldClearCorsConfiguration() { | |
| public boolean ClearCorsConfiguration() { |
Contributor
Author
There was a problem hiding this comment.
Hm, clearCorsConfiguration seems like an action although this is a getter. If you'd like we can rename it to isClearCorsConfiguration?
Comment on lines
+240
to
+250
| if (ex.getResult() == ResultCodes.BUCKET_NOT_FOUND | ||
| || ex.getResult() == ResultCodes.VOLUME_NOT_FOUND) { | ||
| throw newError(S3ErrorTable.NO_SUCH_BUCKET, bucketName, ex); | ||
| } else if (ex.getResult() == ResultCodes.INVALID_TOKEN) { | ||
| throw newError(S3ErrorTable.ACCESS_DENIED, | ||
| s3Auth.getAccessID(), ex); | ||
| } else if (ex.getResult() == ResultCodes.PERMISSION_DENIED) { | ||
| throw newError(S3ErrorTable.ACCESS_DENIED, bucketName, ex); | ||
| } else if (ex.getResult() == ResultCodes.TIMEOUT || | ||
| ex.getResult() == ResultCodes.INTERNAL_ERROR) { | ||
| throw newError(S3ErrorTable.INTERNAL_ERROR, bucketName, ex); |
Member
There was a problem hiding this comment.
can we reuse existing error handler for get 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.
What changes were proposed in this pull request?
Currently, Ozone does not support per-bucket CORS configuration. This means that the CORS configuration is only decided on the reverse proxy that we use (e.g. nginx , HAProxy, etc).
We can implement per-bucket CORS configuration (https://docs.aws.amazon.com/AmazonS3/latest/userguide/cors.html) in Ozone. This way, we can have a separate bucket CORS response for different buckets. CORS is useful if user wanted to fetch S3 object using the browser which respects the CORS mechanism (CORS preflight request, origin validation, response header that can be exposed).
Generated by Codex (GPT 5.4).
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14386
How was this patch tested?
UT, IT, Acceptance Tests.
Clean CI: https://github.com/ivandika3/ozone/actions/runs/24946282586