diff --git a/auth_function/app.py b/auth_function/app.py index c9c164f..a5cfbf5 100644 --- a/auth_function/app.py +++ b/auth_function/app.py @@ -22,7 +22,7 @@ def lambda_handler(event, context): policy.restApiId = apiGatewayArnTmp[0] policy.region = tmp[3] policy.stage = apiGatewayArnTmp[1] - policy.allowMethod('GET', '/auth') + policy.allowMethod('GET', event['path']) authResponse = policy.build() context = { 'SomeKey': 'SomeValue' @@ -52,7 +52,7 @@ class AuthPolicy(object): """The principal used for the policy, this should be a unique identifier for the end user.""" version = "2012-10-17" """The policy version used for the evaluation. This should always be '2012-10-17'""" - pathRegex = "^[/.a-zA-Z0-9-\*]+$" + pathRegex = "^[/.a-zA-Z0-9-_\*]+$" """The regular expression used to validate resource paths for the policy""" """these are the internal lists of allowed and denied methods. These are lists