You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have a AWS::Serverless::HttpApi with a default authorizers, with two authorizers available, and two AWS::Serverless::Function with the same path but different methods, and one of them has overridden the authorizer, the one that does not specify an authorizer does not get any authorizer attached to it.
In other words, if you have a function around with a default authorizer, it works fine. And when you add another function on the same path without changing the original, that does not use the default authorizer, the unchanged initial function gets its authorizer unexpectedly detached.
Steps to reproduce:
Create a AWS::Serverless::HttpApi with two authorizers
Set a DefaultAuthorizer
Create a AWS::Serverless::Function that responds to the HttpApi event type, method Get, path /foo, do not set the Authorizer
Creaate another AWS::Serverless::Function that responds to the HttpApi event type,, with method Put, path /foo, set the Authorizer to the non-default one
Description:
When you have a
AWS::Serverless::HttpApi
with a default authorizers, with two authorizers available, and twoAWS::Serverless::Function
with the same path but different methods, and one of them has overridden the authorizer, the one that does not specify an authorizer does not get any authorizer attached to it.In other words, if you have a function around with a default authorizer, it works fine. And when you add another function on the same path without changing the original, that does not use the default authorizer, the unchanged initial function gets its authorizer unexpectedly detached.
Steps to reproduce:
AWS::Serverless::Function
that responds to the HttpApi event type, method Get, path /foo, do not set the AuthorizerAWS::Serverless::Function
that responds to the HttpApi event type,, with method Put, path /foo, set the Authorizer to the non-default oneObserved result:
In the example, MyFunctionA will have no authorizer attached, and MyFuncitonB will have the LambdaApiAuthorizer attached.
If I explicitly set the authorizer on MyFunctionA, it is attached just fine.
Expected result:
MyFunctionA should have the default authorizer
OAuth2Authorizer
attached, MyFUnctionB should have the LambdaApiAuthorizer attachedAdditional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.31.0Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: