-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(elasticloadbalancingv2): jwt verification for application load balancer #36099
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
base: main
Are you sure you want to change the base?
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.
(This review is outdated)
| * | ||
| * @see https://docs.aws.amazon.com/elasticloadbalancing/latest/application/listener-verify-jwt.html | ||
| */ | ||
| public static authenticateJwt(options: AuthenticateJwtOptions): ListenerAction { |
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.
One suggestion. If Cognito integration is one of main use cases, how about adding a separate method specifically for Cognito like Bedrock AgentCore?
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.
Thank you for the comments! That’s exactly the kind of function implementation I had in mind.
Since the PR might get quite large, I’m planning to first implement a generic authenticateJwt() function, and then add the Cognito-specific implementation in a separate PR.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
| if (listener instanceof ApplicationListener && listener.protocol !== ApplicationProtocol.HTTPS) { | ||
| throw new UnscopedValidationError('JWT authentication requires an HTTPS listener. Please use ApplicationProtocol.HTTPS for the listener protocol.'); | ||
| } |
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.
This condition causes deployment error.
Actions of type 'jwt-validation' are supported only on HTTPS listeners (Service: ElasticLoadBalancingV2, Status Code: 400, 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.
LGTM.
I understand that AdditionalClaims will be added separately.
By the way, I've create the issue in the past, so I would appreciate it if you could link it.
It's not a problem at all, as I haven't started any implementation yet 😀
Issue # (if applicable)
None
Reason for this change
ALB now supports for JWT(JSON Web Token) verification.
https://docs.aws.amazon.com/ja_jp/elasticloadbalancing/latest/application/listener-verify-jwt.html
Description of changes
ListenerAction.authenticateJwt()AuthenticateJwtActionclassI'm currently aiming to implement basic functionality first, so I do not support the
additionalClaimsargument. I will add implementation as needed.Describe any new or updated permissions being added
None
Description of how you validated changes
add both unit and integ tests
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license