-
Notifications
You must be signed in to change notification settings - Fork 4.4k
(aws-apigatewayv2-authorizers): HttpUserPoolAuthorizer constructor should take and array of user pool client ids #15431
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-apigatewayv2-authorizersRelated to aws-apigatewayv2-authorizers packageRelated to aws-apigatewayv2-authorizers packageeffort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.good first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp2
Description
The current HttpUserPoolAuthorizer is created like this
const authorizer = new HttpUserPoolAuthorizer({
userPool: userPool,
userPoolClient: userPoolClient,
});
This will synthesize to
"MyTestHttpProxyPrivateApiUserPoolAuthorizer":{
"Type":"AWS::ApiGatewayV2::Authorizer",
"Properties":{
"ApiId":{
"Ref":"MyTestHttpProxyPrivateApi"
},
"AuthorizerType":"JWT",
"Name":"UserPoolAuthorizer",
"IdentitySource":[
"$request.header.Authorization"
],
"JwtConfiguration":{
"Audience":[
"<user pool id>"
],
"Issuer":"https://cognito-idp.eu-west-1.amazonaws.com/eu-west-1_XXXXXXXXX"
}
}
},
Where the provided user pool client id end up in the Audience array
Use Case
Currently it is possible to provide multiple user pool ids using a HttpJwtAuthorizer
const jwtAuthorizer = new HttpJwtAuthorizer({
jwtAudience: ['XXXXXX', 'YYYYYY'],
jwtIssuer: `https://cognito-idp.eu-west-1.amazonaws.com/eu-west-1_XXXXXXXXX`
})
For consistency and ease of use, HttpUserPoolAuthorizer should also allow users to pass an array of user pool clients, rather than a single one.
Proposed Solution
Allow users to pass an array of user pool clients like so
const authorizer = new HttpUserPoolAuthorizer({
userPool: userPool,
userPoolClient: [userPoolClient1, userPoolClient2, userPoolClient3]
});
- 👋 I may be able to implement this feature request
-
⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-apigatewayv2-authorizersRelated to aws-apigatewayv2-authorizers packageRelated to aws-apigatewayv2-authorizers packageeffort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.good first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp2