-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Fixes for POST policy checks and the x-ignore implementation #20674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for POST policy checks and the x-ignore implementation #20674
Conversation
| "File": true, | ||
| "Policy": true, | ||
|
|
||
| // MinIO specific exceptions to the general S3 rule above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm removing the check strings.HasPrefix(key, encrypt.SseGenericHeader) below, and instead listing out the SSE related header exceptions here.
Please check my assumption that ignoring these SSE headers is still the correct course of action.
| } | ||
|
|
||
| err = checkPostPolicy(formValues, postPolicyForm) | ||
| if err != nil && tt.expectedErr != nil && err.Error() != tt.expectedErr.Error() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was masking the fact that at least one of the existing tests was actually failing.
|
Tests will fail until the |
|
Failing mint test: https://github.com/minio/minio-go/blob/master/functional_tests.go#L5635 And regular test: |
4ff8d70 to
4bb939c
Compare
|
@klauspost Thanks, I fixed the regular test, and yes, Mint tests will fail until the mint image is updated with this: minio/minio-go#1996 What procedure would you prefer to follow here? |
4bb939c to
d2da494
Compare
d2da494 to
1284cf3
Compare
|
Let's get upstream merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few overall Qs.
Co-authored-by: Klaus Post <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Blocked currently by this failing mint test, which is unrelated: I started discussion on the fix to the above test here: #20732 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR already merged in aistor
Community Contribution License
All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.
Description
Related PR: minio/minio-go#1996
X-AWS-Ignore-...was incorrectly implemented according to S3 docs.Content-Encodingshould not be an ignored form field.Motivation and Context
We're not correctly implementing S3 spec, and there are bugs in the implementation we do have.
Our current implementation allows form values like
X-Amz-Ignore-Footo work as directives that tell MinIO to ignoreFooform value, so you could provideFooandX-Amz-Ignore-Footogether, and then we would not check thatFooappears in the policy. This implementation was probably just a misunderstanding or a misread of what the actual behavior should be, as specified here: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.htmlX-Amz-Ignore..is not mentioned at all in AWS docs that I can find. OnlyX-Ignore-..., and the way it works is that any form key starting withX-Ignore-...will be ignored - it does not work as a directive that affects other form keys.How to test this PR?
Types of changes
Checklist:
commit-idorPR #here)