-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: New DisableFunctionDefaultPermissions property to block the cre…
…ation of permissions resource from SAM API Auth (#2885)
- Loading branch information
Showing
18 changed files
with
1,491 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
tests/translator/input/api_rest_auth_disable_default_function_permissions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
Resources: | ||
MyApiWithNoDisableFunctionDefaultPermissions: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: Prod | ||
Auth: | ||
DefaultAuthorizer: Auth | ||
Authorizers: | ||
Auth: | ||
FunctionPayloadType: REQUEST | ||
FunctionArn: !GetAtt MyAuthFn.Arn | ||
FunctionInvokeRole: arn:{AWS::Partition}:iam::123456789012:role/test-role | ||
Identity: | ||
Headers: | ||
- Authorization1 | ||
|
||
MyApiWithLambdaTokenAuth: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: Prod | ||
Auth: | ||
DefaultAuthorizer: LambdaTokenAuth | ||
Authorizers: | ||
LambdaTokenAuth: | ||
FunctionPayloadType: REQUEST | ||
FunctionArn: !GetAtt MyAuthFn.Arn | ||
FunctionInvokeRole: arn:{AWS::Partition}:iam::123456789012:role/test-role | ||
DisableFunctionDefaultPermissions: true | ||
Identity: | ||
Headers: | ||
- Authorization1 | ||
|
||
MyApiWithLambdaRequestAuth: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: Prod | ||
Auth: | ||
DefaultAuthorizer: LambdaRequestAuth | ||
Authorizers: | ||
LambdaRequestAuth: | ||
FunctionPayloadType: REQUEST | ||
FunctionArn: !GetAtt MyAuthFn.Arn | ||
FunctionInvokeRole: arn:{AWS::Partition}:iam::123456789012:role/test-role | ||
DisableFunctionDefaultPermissions: true | ||
Identity: | ||
Headers: | ||
- Authorization1 | ||
|
||
MyApiFunctionEvent: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: Prod | ||
Auth: | ||
DefaultAuthorizer: Auth | ||
Authorizers: | ||
Auth: | ||
FunctionPayloadType: REQUEST | ||
FunctionArn: !GetAtt MyAuthFn.Arn | ||
DisableFunctionDefaultPermissions: true | ||
Identity: | ||
Headers: | ||
- Authorization | ||
|
||
MyAuthFn: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://bucket/key | ||
Handler: index.handler | ||
Runtime: nodejs12.x | ||
MyFn: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://bucket/key | ||
Handler: index.handler | ||
Runtime: nodejs12.x | ||
Events: | ||
LambdaEvent: | ||
Type: Api | ||
Properties: | ||
RestApiId: !Ref MyApiFunctionEvent | ||
Method: get | ||
Path: /foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.