Skip to content

fix: let replicationAdmin set and read bucket replication targets - #292

Merged
taran-p merged 1 commit into
minio:mainfrom
taran-p:fix/replication-admin-bucket-targets
Oct 29, 2026
Merged

taran-p merged 1 commit into
minio:mainfrom
taran-p:fix/replication-admin-bucket-targets

Conversation

@taran-p

@taran-p taran-p commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Adds admin:SetBucketTarget and admin:GetBucketTarget to the replicationAdmin policy so its users can create the remote target that mc replicate add needs (miniohq/aistor#8643).

Summary by CodeRabbit

  • New Features
    • The replication administrator policy now allows users with that policy to view and update bucket target settings.
  • Tests
    • Added coverage confirming these bucket target actions are allowed for a bucket.

mc replicate add creates the remote target before the replication config,
and that needs admin:SetBucketTarget, so a replicationAdmin user could not
set up bucket replication. Grant admin:SetBucketTarget and GetBucketTarget.
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: dad37f27-e48f-4fb0-b772-3406ed5c9f4b
Commits

Reviewing files that changed from the base of the PR and between 1cf596a and cb4e9a2.

Files selected for processing: 2
  • policy/constants.go
  • policy/constants_test.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The replicationAdmin policy now includes SetBucketTargetAction and GetBucketTargetAction in its resource-independent statement. A test checks policy validation and confirms both actions are allowed for bucket photos.

Changes: Replication admin bucket target actions

Layer / File(s) Summary
Add and test bucket target actions
policy/constants.go, policy/constants_test.go
The policy adds SetBucketTargetAction and GetBucketTargetAction to its resource-independent action set. The test checks policy validation and confirms both actions are allowed for bucket photos.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: harshavardhana

Merge Risk: Minimal · up to cb4e9

The targeted policy update and validation test do not present an actionable merge-blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix: let replicationAdmin set and read bucket replication targets" matches the main change. The PR adds SetBucketTargetAction and GetBucketTargetAction to the replicationAdmin canned policy…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix: let replicationAdmin set and read bucket replication targets" matches the main change. The PR adds SetBucketTargetAction and GetBucketTargetAction to the replicationAdmin canned policy, so that role can set and read bucket replication targets. The title is specific and accurate. The title uses a conventional commit prefix, and it is a single sentence of 9 words. The change also includes a test that checks the new permissions for bucket photos.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the policy list,
Two bucket actions join the twist.
Set and get now pass the test,
For photos, both are addressed.
The rabbit hops away to rest.

Comment @coderabbitai help to get the list of available commands.

@taran-p
taran-p requested a review from 0xMALVEE October 29, 2026 20:01
@taran-p
taran-p merged commit f76516c into minio:main Oct 29, 2026
7 checks passed
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.

3 participants