chalice
chalice copied to clipboard
Missing token validation property from custom authorizer
I have setup my custom authorizer using Auth0 and i have to adjust Token Validation parameter to ^Bearer [-0-9a-zA-z\.]*$. Currently the system doesn't utilizing the identityValidationExpression which results in empty Token Validation after each chalice deploy.
E.g: I have created following authorizer from aws console:
After running chalice deploy my custom Token Authorization get vanished:

My code for Custom Verification was:
auth0 = CustomAuthorizer(
name='jwt-rsa-custom-authorizer',
header='Authorization',
ttl_seconds=3600,
authorizer_uri=('uri' )
)
A quick fix in above merge request will allow users to set Token Validation as following:
auth0 = CustomAuthorizer(
name='jwt-rsa-custom-authorizer',
header='Authorization',
ttl_seconds=3600,
token_validation='^Bearer [-0-9a-zA-z\.]*$',
authorizer_uri=('uri' )
)
@jamesls can you review it ?
Thanks for the pull request. Marking this as an enhancement.