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>
(cherry picked from commit df30bf66e8)
This commit is contained in:
1 parent
399772b62a
commit
70614ae5ff
1 file changed
-22
@@ -104,7 +104,6 @@ var AllowedActions = []action{
|
||||
PutBucketTagging,
|
||||
PutBucketVersioning,
|
||||
PutBucketWebsite,
|
||||
PutBucketVersioning,
|
||||
PutLifecycleConfiguration,
|
||||
PutObject,
|
||||
PutObjectAcl,
|
||||
@@ -214,15 +213,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.
|
||||
@@ -299,18 +289,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
|
||||
// //////////////
|
||||
Reference in new issue
Block a user