|
|
@ -92,18 +92,15 @@ func (policy Policy) isValid() error { |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
principals := policy.Statements[i].Principal.Intersection(statement.Principal) |
|
|
|
if !policy.Statements[i].Principal.Equals(statement.Principal) { |
|
|
|
if principals.IsEmpty() { |
|
|
|
|
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
actions := policy.Statements[i].Actions.Intersection(statement.Actions) |
|
|
|
if !policy.Statements[i].Actions.Equals(statement.Actions) { |
|
|
|
if len(actions) == 0 { |
|
|
|
|
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
resources := policy.Statements[i].Resources.Intersection(statement.Resources) |
|
|
|
if !policy.Statements[i].Resources.Equals(statement.Resources) { |
|
|
|
if len(resources) == 0 { |
|
|
|
|
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -112,7 +109,9 @@ func (policy Policy) isValid() error { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return Errorf("duplicate principal %v, actions %v, resouces %v found in statements %v, %v", |
|
|
|
return Errorf("duplicate principal %v, actions %v, resouces %v found in statements %v, %v", |
|
|
|
principals, actions, resources, policy.Statements[i], statement) |
|
|
|
statement.Principal, statement.Actions, |
|
|
|
|
|
|
|
statement.Resources, policy.Statements[i], |
|
|
|
|
|
|
|
statement) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|