Skip to content
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

change bucket policy validation order in bucketspace-fs #7946

Merged

Conversation

nadavMiz
Copy link
Contributor

@nadavMiz nadavMiz commented Apr 3, 2024

Explain the changes

  1. in bucketspace-fs validate_s3_policy was called before the policy schema validation, causing it to fail with an internal error. changed the order so the schema will be validated before. That way in the case of schema error, we will return malformed policy

Issues: Fixed #xxx / Gap #xxx

  1. https://bugzilla.redhat.com/show_bug.cgi?id=2272386

Testing Instructions:

  1. create a bucket policy without a principal
  2. using NSFS try to push this policy: aws s3api put-bucket-policy --bucket <bucket-name> --policy file://policy.json
  3. should fail with MalformedPolicy. should not fail with InternalError
  • Doc added/updated
  • Tests added

@nadavMiz nadavMiz requested a review from romayalon April 3, 2024 09:33
Signed-off-by: nadav mizrahi <nadav.mizrahi16@gmail.com>
@nadavMiz nadavMiz force-pushed the fix-bucket-policy-validiation-order branch from 4b3f4b3 to 1445297 Compare April 7, 2024 13:04
@nadavMiz nadavMiz merged commit dbd968c into noobaa:master Apr 7, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants