aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Feature request: allow to choose one authorizer when there's more than one

Open RecuencoJones opened this issue 2 years ago • 4 comments

Describe your idea/feature/enhancement

There are APIs where more than one Authorizer may be used, for example an api key + Authorization header. In those cases sam local start-api fails with:

Error: There must only be a single authorizer defined for path='/' method='get', found '2'

Proposal

Add some flag that allows the user to choose one instead of bypassing the authorizer:

sam local start-api --authorizer AzureAuthorizer

RecuencoJones avatar Jan 31 '24 14:01 RecuencoJones

Thanks for the feature request, I will bring it to the team for prioritization.

mndeveci avatar Feb 02 '24 01:02 mndeveci

Hi @RecuencoJones

Can you share an example template which has multiple authorizers setup for single route?

mndeveci avatar Feb 05 '24 22:02 mndeveci

Hi @mndeveci I will try to create a simple repository and share how we are working this around

RecuencoJones avatar Feb 07 '24 17:02 RecuencoJones

Hi @mndeveci I created a reproduction repository here https://github.com/RecuencoJones/SAM-CLI-issue-6628 please let me know if this is good enough!

RecuencoJones avatar Feb 09 '24 10:02 RecuencoJones