feat: annotation copy-directive condition key and replication actions#239
Conversation
…ions Add the s3:x-amz-annotation-directive condition key (CopyObject COPY/EXCLUDE) and the s3:ReplicateObjectAnnotation / s3:GetObjectVersionAnnotationForReplication actions for object annotation replication.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTwo new exported ChangesS3 Annotation Replication Actions and Condition Key
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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/action.go`:
- Around line 315-317: The two new actions ReplicateObjectAnnotationAction and
GetObjectVersionAnnotationForReplicationAction are registered as supported
actions but are missing entries in the createActionConditionKeyMap function. Add
condition-key map entries for both ReplicateObjectAnnotationAction and
GetObjectVersionAnnotationForReplicationAction in the
createActionConditionKeyMap function, mapping them to their appropriate
condition keys (following the pattern of similar replication or
annotation-related actions already defined in the map). This ensures these
actions have explicit action-scoped condition keys instead of relying on common
fallback keys, preventing incorrect IAM condition behavior.
🪄 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: f4d037b3-0d4e-41bd-a0c5-339dc95eb9af
📒 Files selected for processing (2)
policy/action.gopolicy/condition/keyname.go
ReplicateObjectAnnotation and GetObjectVersionAnnotationForReplication now carry the same action-scoped condition keys (versionid, ExistingObjectTag) as the other replication actions, instead of common keys only.
Follow-up to #238 (object annotation IAM actions).
s3:x-amz-annotation-directive(CopyObject COPY/EXCLUDE), wired intoPutObjectAction.s3:ReplicateObjectAnnotationands3:GetObjectVersionAnnotationForReplicationfor annotation replication, registered in the supported action sets and condition-key map.Summary by CodeRabbit
x-amz-annotation-directivecondition key to enable more granular policy control for object operations (includingCopyObject).