Skip to content

events: add Condition field to IAMPolicyStatement#636

Open
larrasket wants to merge 1 commit into
aws:mainfrom
larrasket:add-condition-to-iam-policy-statement
Open

events: add Condition field to IAMPolicyStatement#636
larrasket wants to merge 1 commit into
aws:mainfrom
larrasket:add-condition-to-iam-policy-statement

Conversation

@larrasket

Copy link
Copy Markdown

IAMPolicyStatement is the element of the policy a Lambda custom authorizer returns (and of IoT policy documents), which follow the IAM JSON policy grammar where Condition is a first-class element. The struct had no Condition field, so any condition block was silently dropped on (un)marshal.

Add Condition as map[string]map[string]interface{} with omitempty. The interface{} value type is required because a condition value may be a single string or an array of strings; omitempty keeps condition-less statements serializing unchanged (keeping the custom-authorizer response golden test green).

Fixes #458

IAMPolicyStatement is the element of the policy a Lambda custom authorizer
returns (and of IoT policy documents), which follow the IAM JSON policy
grammar where Condition is a first-class element. The struct had no Condition
field, so any condition block was silently dropped on (un)marshal.

Add Condition as map[string]map[string]interface{} with omitempty. The
interface{} value type is required because a condition value may be a single
string or an array of strings; omitempty keeps condition-less statements
serializing unchanged (keeping the custom-authorizer response golden test green).

Fixes aws#458
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

There is no Condition field in the IAMPolicyStatement

1 participant