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

Support custom authorizers #22

Closed
HyperBrain opened this issue Mar 27, 2017 · 8 comments
Closed

Support custom authorizers #22

HyperBrain opened this issue Mar 27, 2017 · 8 comments
Assignees
Labels
Milestone

Comments

@HyperBrain
Copy link
Member

Custom authorizers should also be supported by the plugin, i.e. if a service defines custom authorizers, they have to be assigned to the correct stage and either the referenced alias lambda has to be set as target or, in case a full qualified arn has been given, this has to be set.

#21 Is caused by the missing feature.

@HyperBrain HyperBrain added this to the beta milestone Mar 27, 2017
@HyperBrain HyperBrain self-assigned this Mar 27, 2017
@andrewkuzmych
Copy link

+1

@HyperBrain
Copy link
Member Author

The referenced lambda function has to be completed with the alias stage variable - myAuth-func:${stageVariables.SERVERLESS_ALIAS}
This will work in the first place. It has to be checked, if deployments from different aliases with changed authorizer configurations (like header spec etc.) will cause unwanted behaviors.
Otherwise the authorizer should be renamed by the plugin and deployed separately per alias.

@HyperBrain
Copy link
Member Author

Authorizers do not support APIG stage variables. The authorizer is renamed to include the deployed alias and points to the correct aliased function version.
Verified the functionality with a test project and by creating a Swagger definition of the deployed stage from the AWS APIG console.

@HyperBrain
Copy link
Member Author

HyperBrain commented May 29, 2017

@vkkis93 Could you try if it works for you? Then I will prepare the 1.2.0 release tomorrow.

@vkkis93
Copy link
Contributor

vkkis93 commented Jun 6, 2017

@HyperBrain Why previous serverless@0.5 for example has correct authorizer function
it has func:${stageVariables.functionAlias}
I don't understand why we can not set func:${stageVariables.SERVERLESS_ALIAS}

@HyperBrain
Copy link
Member Author

Ok. I will check how exactly the 0.5 version created the authorizer - I'll try to use the same parameters then and see if it works.

@vkkis93
Copy link
Contributor

vkkis93 commented Jun 6, 2017

Can we do like this ?
uriParts.splice(funcIndex + 1, 0, '${stageVariables.SERVERLESS_ALIAS}');

@HyperBrain
Copy link
Member Author

Can you try this locally and check if the deployment works with the API console and a deployed API?
If it works, I have no objections against this solution.

HyperBrain added a commit that referenced this issue Jun 6, 2017
Relates to #22 
fix authorizer Uri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants