Skip to content

Commit

Permalink
validate duplicate policy members
Browse files Browse the repository at this point in the history
  • Loading branch information
rmb938 committed Jun 24, 2018
1 parent aabc517 commit 88c90a9
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ def validate_member(self, value, context=None):

class PolicyBinding(Model):
role = KubeName(required=True)
members = ListType(BindingMemberType)
members = ListType(BindingMemberType, required=True)

def validate_members(self, data, value):
for member in value:
if value.count(member) > 1:
raise ValidationError(member + " appears multiple times in the binding")

return value


class ResponsePolicy(Model):
Expand Down

0 comments on commit 88c90a9

Please sign in to comment.