Skip to content

Restrict S3 Management to users with write permission#178

Merged
rbardaji merged 2 commits into
mainfrom
feature/177-restrict-s3-management-to-writers
May 26, 2026
Merged

Restrict S3 Management to users with write permission#178
rbardaji merged 2 commits into
mainfrom
feature/177-restrict-s3-management-to-writers

Conversation

@rbardaji

Copy link
Copy Markdown
Collaborator

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

  • UI: the S3 Management navigation entry is only shown to writers/admins (canWrite); viewers and no-role users no longer see it.
  • API: /s3/buckets and /s3/objects endpoints now depend on get_user_for_write_operation instead of get_current_user. Read-only users receive 403 Forbidden.
  • Tests: new tests/test_minio_routes_auth.py asserts every S3 Management endpoint is writer-only and that writers pass the guard.
  • Version bumped to 0.31.0 (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/buckets and /s3/objects: callers that previously relied on viewer-level (or no-role) access now receive 403 and must hold the writer role. Writers and admins are unaffected.

Testing

  • Full suite: 1154 passed.
  • black --check and flake8 (CI flags) clean.

Closes #177

Raul Bardaji 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
@rbardaji rbardaji merged commit 66c7243 into main May 26, 2026
1 check passed
@rbardaji rbardaji deleted the feature/177-restrict-s3-management-to-writers branch May 26, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restrict S3 Management to users with write permission

1 participant