-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(iam): withConditions overrides Principal actions #28510
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice fix! Thank you!
@@ -264,6 +264,18 @@ export class PrincipalWithConditions extends PrincipalAdapter { | |||
this.additionalConditions = conditions; | |||
} | |||
|
|||
public addToAssumeRolePolicy(doc: PolicyDocument) { | |||
// eslint-disable-next-line @typescript-eslint/no-require-imports | |||
const adapter: typeof import('./private/policydoc-adapter') = require('./private/policydoc-adapter'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll ask the question: why are we doing this weird import here? I assume something is stopping us from importing MutatingPolicyDocumentAdapter
the normal way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent a circular dependency on imports (it seems on PolicyDocument
) as done here.
I added a comment to clarify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect thanks. My next comment was going to be that if I'm confused, so will people who look at the code in the future!
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Pull request has been modified.
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Calling `withConditions` after `withSessionTags` will override the existing `sts:TagSession` action for the statement. This implementation fixes the issue. Closes aws#28426. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Calling
withConditions
afterwithSessionTags
will override the existingsts:TagSession
action for the statement.This implementation fixes the issue.
Closes #28426.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license