iam: Converters should handle * wildcard properly #22

Closed
opened 2023-11-27 09:59:52 +00:00 by dkirillov · 0 comments
Member

The following test should pass because of * is valid value for resource (according to spec)

func TestShouldPass(t *testing.T) {
	policy := `{"Version":"2012-10-17","Statement":{"Effect":"Allow", "Principal": "*", "Action":"*","Resource":"*"}}`

	var p Policy
	err := json.Unmarshal([]byte(policy), &p)
	require.NoError(t, err)

	_, err = ConvertToNativeChain(p, newMockUserResolver(nil, nil))
	require.NoError(t, err)
}
The following test should pass because of `*` is valid value for resource (according to [spec](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_grammar.html)) ```golang func TestShouldPass(t *testing.T) { policy := `{"Version":"2012-10-17","Statement":{"Effect":"Allow", "Principal": "*", "Action":"*","Resource":"*"}}` var p Policy err := json.Unmarshal([]byte(policy), &p) require.NoError(t, err) _, err = ConvertToNativeChain(p, newMockUserResolver(nil, nil)) require.NoError(t, err) } ```
dkirillov added the
bug
label 2023-11-27 09:59:52 +00:00
dkirillov self-assigned this 2023-11-27 09:59:52 +00:00
dkirillov referenced this issue from a commit 2023-11-29 09:51:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/policy-engine#22
No description provided.