policy: rename DeltaSharing actions to TableSharing, add OpenSharing aliases#237
policy: rename DeltaSharing actions to TableSharing, add OpenSharing aliases#237harshavardhana wants to merge 1 commit into
Conversation
…aliases TableSharing is the canonical name for MinIO AIStor. OpenSharing is the open-standard protocol name. Both are aliases that resolve to the same admin:TableSharing* action strings, so no policy migration is needed. DeltaSharing constants are kept as source-compatible aliases for existing callers but all three families now map to the same wire values.
📝 WalkthroughWalkthroughThe PR introduces canonical ChangesTable Sharing Admin Actions
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@policy/admin-action.go`:
- Around line 312-328: The DeltaSharing* aliases (e.g.,
DeltaSharingCreateShareAction) must remain accepted by string-based
validation/matching: update SupportedAdminActions and/or AdminAction.IsValid()
to recognize legacy "admin:DeltaSharing*" literals while keeping the canonical
constants as TableSharing*; specifically ensure DeltaSharingCreateShareAction,
DeltaSharingDeleteShareAction, DeltaSharingListSharesAction,
DeltaSharingGetShareAction, DeltaSharingUpdateShareAction,
DeltaSharingCreateTokenAction, DeltaSharingDeleteTokenAction,
DeltaSharingListTokensAction are included in the set checked by
SupportedAdminActions (or have IsValid() consult a backward-compatibility map
from legacy string -> canonical TableSharing*), so persisted policies containing
"admin:DeltaSharing..." continue to validate/match but any new outputs still use
the TableSharing* canonical names.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: df4f939c-e1ba-44b2-a39f-a0ae3ce9501b
📒 Files selected for processing (1)
policy/admin-action.go
| DeltaSharingAdminAction = TableSharingAdminAction | ||
| // DeltaSharingCreateShareAction - allow creating Delta Sharing shares | ||
| DeltaSharingCreateShareAction = "admin:DeltaSharingCreateShare" | ||
| DeltaSharingCreateShareAction = TableSharingCreateShareAction | ||
| // DeltaSharingDeleteShareAction - allow deleting Delta Sharing shares | ||
| DeltaSharingDeleteShareAction = "admin:DeltaSharingDeleteShare" | ||
| DeltaSharingDeleteShareAction = TableSharingDeleteShareAction | ||
| // DeltaSharingListSharesAction - allow listing Delta Sharing shares | ||
| DeltaSharingListSharesAction = "admin:DeltaSharingListShares" | ||
| DeltaSharingListSharesAction = TableSharingListSharesAction | ||
| // DeltaSharingGetShareAction - allow getting Delta Sharing share details | ||
| DeltaSharingGetShareAction = "admin:DeltaSharingGetShare" | ||
| DeltaSharingGetShareAction = TableSharingGetShareAction | ||
| // DeltaSharingUpdateShareAction - allow updating Delta Sharing shares | ||
| DeltaSharingUpdateShareAction = "admin:DeltaSharingUpdateShare" | ||
| DeltaSharingUpdateShareAction = TableSharingUpdateShareAction | ||
| // DeltaSharingCreateTokenAction - allow creating Delta Sharing tokens | ||
| DeltaSharingCreateTokenAction = "admin:DeltaSharingCreateToken" | ||
| DeltaSharingCreateTokenAction = TableSharingCreateTokenAction | ||
| // DeltaSharingDeleteTokenAction - allow deleting Delta Sharing tokens | ||
| DeltaSharingDeleteTokenAction = "admin:DeltaSharingDeleteToken" | ||
| DeltaSharingDeleteTokenAction = TableSharingDeleteTokenAction | ||
| // DeltaSharingListTokensAction - allow listing Delta Sharing tokens | ||
| DeltaSharingListTokensAction = "admin:DeltaSharingListTokens" | ||
| DeltaSharingListTokensAction = TableSharingListTokensAction |
There was a problem hiding this comment.
Legacy admin:DeltaSharing* policy strings are no longer recognized.
Line 312-328 aliases DeltaSharing* identifiers to new admin:TableSharing* values, and Line 439-447 registers only TableSharing* in SupportedAdminActions. Because validation/matching is string-based (see AdminAction.IsValid()), persisted policies containing old literals like admin:DeltaSharingCreateShare will fail to validate/match after upgrade.
Please preserve legacy wire-string compatibility (e.g., keep legacy admin:DeltaSharing* strings accepted in validation/matching, even if canonical output is TableSharing*).
Based on learnings, rename/removal should be treated as breaking specifically when persisted policy data may still reference old action strings, which is the risk introduced here.
Also applies to: 439-447
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@policy/admin-action.go` around lines 312 - 328, The DeltaSharing* aliases
(e.g., DeltaSharingCreateShareAction) must remain accepted by string-based
validation/matching: update SupportedAdminActions and/or AdminAction.IsValid()
to recognize legacy "admin:DeltaSharing*" literals while keeping the canonical
constants as TableSharing*; specifically ensure DeltaSharingCreateShareAction,
DeltaSharingDeleteShareAction, DeltaSharingListSharesAction,
DeltaSharingGetShareAction, DeltaSharingUpdateShareAction,
DeltaSharingCreateTokenAction, DeltaSharingDeleteTokenAction,
DeltaSharingListTokensAction are included in the set checked by
SupportedAdminActions (or have IsValid() consult a backward-compatibility map
from legacy string -> canonical TableSharing*), so persisted policies containing
"admin:DeltaSharing..." continue to validate/match but any new outputs still use
the TableSharing* canonical names.
Source: Learnings
Summary
TableSharing*admin action constants (admin:TableSharing*) as the canonical name for MinIO AIStorOpenSharing*as source-level aliases resolving to the same action strings (open-standard protocol name)DeltaSharing*as source-compatible aliases so existing callers compile without changesSupportedAdminActions, no extra policy lookups, no migration neededValidation
Both pass clean.
Summary by CodeRabbit