Skip to content

feat: add ActionType generic constraint for policy actions#245

Merged
harshavardhana merged 1 commit into
minio:mainfrom
harshavardhana:feat/policy-action-constraint
Jul 16, 2026
Merged

feat: add ActionType generic constraint for policy actions#245
harshavardhana merged 1 commit into
minio:mainfrom
harshavardhana:feat/policy-action-constraint

Conversation

@harshavardhana

Copy link
Copy Markdown
Member

Description

Adds policy.ActionType, a generic constraint that is the union of the policy
action types:

type ActionType interface {
    Action | AdminAction | STSAction | KMSAction | TableAction | VectorsAction | MemoryAction
}

It lets generic auth helpers accept any typed action without forcing callers to
convert to Action at each call site, while a bare string stays excluded
(so it's tighter than ~string).

Motivation

Consumers (e.g. MinIO AIStor) have request-auth helpers typed on policy.Action.
As more service action types are added (TableAction, VectorsAction,
MemoryAction, …), callers must wrap each typed constant in policy.Action(...).
A shared constraint lets those helpers become generic over ActionType and drop
the per-call conversions, keeping the single Action conversion at the boundary
where the policy engine evaluates.

Changes

  • policy/action-constraint.go — the ActionType union constraint.

No behavior change; type-level addition only. go build ./... and
go vet ./policy/... pass.

ActionType is a union of the policy action types (Action, AdminAction,
STSAction, KMSAction, TableAction, VectorsAction, MemoryAction). It lets
generic auth helpers accept any typed action without per-call conversion to
Action, while a bare string stays excluded.
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@harshavardhana, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fde4d927-6c86-4716-b71e-264a68f2ce45

📥 Commits

Reviewing files that changed from the base of the PR and between 4575139 and 6f5e79b.

📒 Files selected for processing (1)
  • policy/action-constraint.go

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

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

@harshavardhana
harshavardhana requested a review from Copilot July 16, 2026 18:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@harshavardhana
harshavardhana merged commit 839042d into minio:main Jul 16, 2026
11 checks passed
@harshavardhana
harshavardhana deleted the feat/policy-action-constraint branch July 16, 2026 18:50
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.

2 participants