object: remove dead EjectPrincipals methods and duplicate AllowedActions entry

Remove (*BucketPolicy).EjectPrincipals and (*PolicyStatement).EjectPrincipals,
which had no callers outside policy.go. Also drop the duplicate PutBucketVersioning
entry in AllowedActions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
This commit is contained in:
Joshua HoblittandClaude Sonnet 4.6 committed 2026-06-03 09:39:12 -07:00
1 parent 67395ad5e4
commit df30bf66e8
1 file changed
-22
-22
View File
@@ -104,7 +104,6 @@ var AllowedActions = []action{
PutBucketTagging,
PutBucketVersioning,
PutBucketWebsite,
PutBucketVersioning,
PutLifecycleConfiguration,
PutObject,
PutObjectAcl,
@@ -225,15 +224,6 @@ func (bp *BucketPolicy) DropPolicyStatements(sid ...string) *BucketPolicy {
return bp
}
func (bp *BucketPolicy) EjectPrincipals(users ...string) *BucketPolicy {
statements := bp.Statement
for _, s := range statements {
s.EjectPrincipals(users...)
}
bp.Statement = statements
return bp
}
// NewPolicyStatement generates a new PolicyStatement. PolicyStatement methods are designed to
// be chain called with dot notation to allow for easy configuration at creation. This is preferable
// to a long parameter list.
@@ -310,18 +300,6 @@ func (ps *PolicyStatement) Actions(actions ...action) *PolicyStatement {
return ps
}
func (ps *PolicyStatement) EjectPrincipals(users ...string) {
principals := ps.Principal[awsPrinciple]
for _, u := range users {
for j, v := range principals {
if u == v {
principals = append(principals[:j], principals[:j+1]...)
}
}
}
ps.Principal[awsPrinciple] = principals
}
// //////////////
// End Policy
// //////////////