-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
stage/needs-triageAutomatically applied to new issues and PRs, indicating they haven't been looked at.Automatically applied to new issues and PRs, indicating they haven't been looked at.
Description
Description
I am not able to set IdentitySource for REQUEST Authorizer in SAM.
Auth:
Authorizers:
MyAuthorizer:
AuthorizerPayloadFormatVersion: "2.0"
EnableSimpleResponses: true
AuthorizerResultTtlInSeconds: 300
AuthorizerType: REQUEST
IdentitySource:
- $request.header.someheader
FunctionArn: ...
I get the following error: "IdentitySource must be defined only for OAuth2 Authorizer."
What is odd to me that when I set the field in AWS Dashboard and pull the configuration, the property is there:
"Items": [
{
"AuthorizerId": ...
"AuthorizerPayloadFormatVersion": "2.0",
"AuthorizerType": "REQUEST",
"AuthorizerUri": ...,
"EnableSimpleResponses": true,
"IdentitySource": [
"$request.header.someheader"
],
"Name": ...
}
]
Could this check be removed?
if self.id_source is not None and not authorizer_type == "JWT":
raise InvalidResourceException(
self.api_logical_id, "IdentitySource must be defined only for OAuth2 Authorizer."
)
Steps to reproduce
Create a REQUEST authorizer with explicitly set identity source as explained above.
Observed result
It will fail with "IdentitySource must be defined only for OAuth2 Authorizer."
Expected result
It accepts the IdentitySource property and applies it in the cloud.
Additional environment details
- OS: Ubtuntu
- If using the SAM CLI,
sam --version: - AWS region: us-east-1
Metadata
Metadata
Assignees
Labels
stage/needs-triageAutomatically applied to new issues and PRs, indicating they haven't been looked at.Automatically applied to new issues and PRs, indicating they haven't been looked at.