Skip to content
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(apigateway): allow overriding authorizer on methods #30415

Merged
merged 5 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
{
"Resources": {
"UserPool6BA7E5F2": {
"Type": "AWS::Cognito::UserPool",
"Properties": {
"AccountRecoverySetting": {
"RecoveryMechanisms": [
{
"Name": "verified_phone_number",
"Priority": 1
},
{
"Name": "verified_email",
"Priority": 2
}
]
},
"AdminCreateUserConfig": {
"AllowAdminCreateUserOnly": false
},
"AutoVerifiedAttributes": [
"email"
],
"EmailVerificationMessage": "The verification code to your new account is {####}",
"EmailVerificationSubject": "Verify your new account",
"SmsVerificationMessage": "The verification code to your new account is {####}",
"UsernameAttributes": [
"email"
],
"VerificationMessageTemplate": {
"DefaultEmailOption": "CONFIRM_WITH_CODE",
"EmailMessage": "The verification code to your new account is {####}",
"EmailSubject": "Verify your new account",
"SmsMessage": "The verification code to your new account is {####}"
}
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"AuthorizerBD825682": {
"Type": "AWS::ApiGateway::Authorizer",
"Properties": {
"IdentitySource": "method.request.header.Authorization",
"Name": "integtestrestapiwithoverridingdefaultauthorizerAuthorizerF0743170",
"ProviderARNs": [
{
"Fn::GetAtt": [
"UserPool6BA7E5F2",
"Arn"
]
}
],
"RestApiId": {
"Ref": "ActionsApiGatewayF80386B7"
},
"Type": "COGNITO_USER_POOLS"
}
},
"ActionsApiGatewayF80386B7": {
"Type": "AWS::ApiGateway::RestApi",
"Properties": {
"Name": "Actions-ApiGateway"
}
},
"ActionsApiGatewayDeployment50B6E6A66403e42852ae63ad13a2b7635300f8a9": {
"Type": "AWS::ApiGateway::Deployment",
"Properties": {
"Description": "Automatically created by the RestApi construct",
"RestApiId": {
"Ref": "ActionsApiGatewayF80386B7"
}
},
"DependsOn": [
"ActionsApiGatewayANY11FE5E47",
"ActionsApiGatewayGET12E87C75",
"ActionsApiGatewayOPTIONS8EA1F997",
"AuthorizerBD825682"
]
},
"ActionsApiGatewayDeploymentStageprod812022BF": {
"Type": "AWS::ApiGateway::Stage",
"Properties": {
"DeploymentId": {
"Ref": "ActionsApiGatewayDeployment50B6E6A66403e42852ae63ad13a2b7635300f8a9"
},
"RestApiId": {
"Ref": "ActionsApiGatewayF80386B7"
},
"StageName": "prod"
}
},
"ActionsApiGatewayOPTIONS8EA1F997": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
"ApiKeyRequired": false,
"AuthorizationType": "NONE",
"HttpMethod": "OPTIONS",
"Integration": {
"IntegrationResponses": [
{
"ResponseParameters": {
"method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'",
"method.response.header.Access-Control-Allow-Origin": "'*'",
"method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET,PUT,POST,DELETE,PATCH,HEAD'",
"method.response.header.Access-Control-Max-Age": "'864000'"
},
"StatusCode": "204"
}
],
"RequestTemplates": {
"application/json": "{ statusCode: 200 }"
},
"Type": "MOCK"
},
"MethodResponses": [
{
"ResponseParameters": {
"method.response.header.Access-Control-Allow-Headers": true,
"method.response.header.Access-Control-Allow-Origin": true,
"method.response.header.Access-Control-Allow-Methods": true,
"method.response.header.Access-Control-Max-Age": true
},
"StatusCode": "204"
}
],
"ResourceId": {
"Fn::GetAtt": [
"ActionsApiGatewayF80386B7",
"RootResourceId"
]
},
"RestApiId": {
"Ref": "ActionsApiGatewayF80386B7"
}
}
},
"ActionsApiGatewayANY11FE5E47": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
"AuthorizationType": "NONE",
"HttpMethod": "ANY",
"Integration": {
"IntegrationResponses": [
{
"StatusCode": "200"
}
],
"PassthroughBehavior": "NEVER",
"RequestTemplates": {
"application/json": "{ \"statusCode\": 200 }"
},
"Type": "MOCK"
},
"MethodResponses": [
{
"StatusCode": "200"
}
],
"ResourceId": {
"Fn::GetAtt": [
"ActionsApiGatewayF80386B7",
"RootResourceId"
]
},
"RestApiId": {
"Ref": "ActionsApiGatewayF80386B7"
}
}
},
"ActionsApiGatewayGET12E87C75": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
"AuthorizationScopes": [
"scope"
],
"AuthorizationType": "COGNITO_USER_POOLS",
"AuthorizerId": {
"Ref": "AuthorizerBD825682"
},
"HttpMethod": "GET",
"Integration": {
"IntegrationResponses": [
{
"StatusCode": "200"
}
],
"PassthroughBehavior": "NEVER",
"RequestTemplates": {
"application/json": "{ \"statusCode\": 200 }"
},
"Type": "MOCK"
},
"MethodResponses": [
{
"StatusCode": "200"
}
],
"ResourceId": {
"Fn::GetAtt": [
"ActionsApiGatewayF80386B7",
"RootResourceId"
]
},
"RestApiId": {
"Ref": "ActionsApiGatewayF80386B7"
}
}
}
},
"Outputs": {
"ActionsApiGatewayEndpoint261B645B": {
"Value": {
"Fn::Join": [
"",
[
"https://",
{
"Ref": "ActionsApiGatewayF80386B7"
},
".execute-api.",
{
"Ref": "AWS::Region"
},
".",
{
"Ref": "AWS::URLSuffix"
},
"/",
{
"Ref": "ActionsApiGatewayDeploymentStageprod812022BF"
},
"/"
]
]
}
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}
Loading