Restrict S3 Management to users with write permission#178
Merged
Conversation
added 2 commits
May 26, 2026 02:41
The S3 Management tool (bucket/object management) was reachable by any authenticated user. Gate it behind the writer role: - UI: only show the S3 Management nav entry to writers/admins (canWrite). - API: the /s3/buckets and /s3/objects endpoints now depend on get_user_for_write_operation instead of get_current_user, so viewers and users with no role get 403. - Add tests covering that every S3 Management endpoint is writer-only. Closes #177
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.
Summary
S3 Management (bucket/object management) was reachable by any authenticated user, regardless of role. This restricts it to users with write permission (writers and admins), consistent with the viewer/writer/admin model used elsewhere.
Changes
canWrite); viewers and no-role users no longer see it./s3/bucketsand/s3/objectsendpoints now depend onget_user_for_write_operationinstead ofget_current_user. Read-only users receive403 Forbidden.tests/test_minio_routes_auth.pyasserts every S3 Management endpoint is writer-only and that writers pass the guard.swagger_settings.py+CHANGELOG.md).Backwards compatibility
Request/response shapes and route paths are unchanged. The only change is the required permission level on
/s3/bucketsand/s3/objects: callers that previously relied on viewer-level (or no-role) access now receive403and must hold the writer role. Writers and admins are unaffected.Testing
black --checkandflake8(CI flags) clean.Closes #177