feat(s3): add S3_SKIP_POLICY env variable to disable setBucketPolicy#1362
Merged
DavidsonGomes merged 1 commit intoEvolutionAPI:developfrom Apr 8, 2025
Merged
feat(s3): add S3_SKIP_POLICY env variable to disable setBucketPolicy#1362DavidsonGomes merged 1 commit intoEvolutionAPI:developfrom
DavidsonGomes merged 1 commit intoEvolutionAPI:developfrom
Conversation
…for incompatible providers
Contributor
Reviewer's Guide by SourceryThis pull request introduces the Sequence diagram for creating a bucket with optional policy settingsequenceDiagram
participant App
participant MinIO Client
App->>MinIO Client: createBucket(bucketName)
MinIO Client->>MinIO Client: Check if bucket exists
alt Bucket does not exist
MinIO Client->>MinIO Client: makeBucket(bucketName)
end
alt SKIP_POLICY is false
App->>MinIO Client: setBucketPolicy()
else SKIP_POLICY is true
App->>App: Skip setBucketPolicy()
end
MinIO Client-->>App: Success or Error
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey @Deyvi-dev - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider renaming
S3_SKIP_POLICYtoS3_SET_BUCKET_POLICY_ENABLEDto avoid the double negative. - It might be helpful to add a log when the bucket policy is skipped, to make debugging easier.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Some S3-compatible providers like DigitalOcean Spaces do not support setting bucket policies via the MinIO client. This PR adds a conditional to skip this step when the provider does not support it.
Summary by Sourcery
Add an environment variable to conditionally skip setting bucket policies for S3-compatible storage providers that do not support this operation
New Features:
Enhancements:
@DavidsonGomes