default to common conditions if conditions not present (#11546)

fixes #11544
This commit is contained in:
Harshavardhana
2021-02-16 11:56:45 -08:00
committed by GitHub
parent 7d4a2d2b68
commit 87cce344f6
2 changed files with 6 additions and 46 deletions

View File

@@ -114,13 +114,8 @@ func (statement Statement) isValid() error {
return Errorf("unsupported Resource found %v for action %v", statement.Resources, action)
}
condKeys, ok := iamActionConditionKeyMap.Lookup(action)
if !ok {
return Errorf("conditions are not supported for action %v", action)
}
keys := statement.Conditions.Keys()
keyDiff := keys.Difference(condKeys)
keyDiff := keys.Difference(iamActionConditionKeyMap.Lookup(action))
if !keyDiff.IsEmpty() {
return Errorf("unsupported condition keys '%v' used for action '%v'", keyDiff, action)
}