Skip to content

Commit

Permalink
expose IsObjectAction helper (#57)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
  • Loading branch information
dvaldivia authored Feb 21, 2023
1 parent 797e92e commit fe221d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bucket/policy/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ var supportedObjectActions = map[Action]struct{}{
ResetBucketReplicationStateAction: {},
}

// isObjectAction - returns whether action is object type or not.
func (action Action) isObjectAction() bool {
// IsObjectAction - returns whether action is object type or not.
func (action Action) IsObjectAction() bool {
_, ok := supportedObjectActions[action]
return ok
}
Expand Down
2 changes: 1 addition & 1 deletion bucket/policy/action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestActionIsObjectAction(t *testing.T) {
}

for i, testCase := range testCases {
result := testCase.action.isObjectAction()
result := testCase.action.IsObjectAction()

if testCase.expectedResult != result {
t.Fatalf("case %v: expected: %v, got: %v", i+1, testCase.expectedResult, result)
Expand Down
2 changes: 1 addition & 1 deletion bucket/policy/statement.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (statement Statement) isValid() error {
}

for action := range statement.Actions {
if action.isObjectAction() {
if action.IsObjectAction() {
if !statement.Resources.objectResourceExists() {
return Errorf("unsupported Resource found %v for action %v", statement.Resources, action)
}
Expand Down

0 comments on commit fe221d2

Please sign in to comment.