From 08c8709b4fb04f7c9dd1767fab1192ae7ae96e2a Mon Sep 17 00:00:00 2001 From: Adrian Czarnecki Date: Fri, 21 Sep 2018 09:37:43 +0200 Subject: [PATCH] Fix policy check for healthcheck and version Change-Id: I436b7ade5ff6f890eab56439a8b2219421518ce0 --- monasca_log_api/app/api.py | 8 ++++++-- monasca_log_api/policies/healthchecks.py | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/monasca_log_api/app/api.py b/monasca_log_api/app/api.py index 53d278ce..968a6591 100644 --- a/monasca_log_api/app/api.py +++ b/monasca_log_api/app/api.py @@ -74,7 +74,9 @@ def create_version_app(global_conf, **local_conf): '/version/{version_id}': ctrl # display details of the version } - wsgi_app = falcon.API() + wsgi_app = falcon.API( + request_type=request.Request + ) for route, ctrl in controllers.items(): wsgi_app.add_route(route, ctrl) return wsgi_app @@ -89,7 +91,9 @@ def create_healthcheck_app(global_conf, **local_conf): '/': ctrl } - wsgi_app = falcon.API() + wsgi_app = falcon.API( + request_type=request.Request + ) for route, ctrl in controllers.items(): wsgi_app.add_route(route, ctrl) return wsgi_app diff --git a/monasca_log_api/policies/healthchecks.py b/monasca_log_api/policies/healthchecks.py index 6be5d73d..c5233d4b 100644 --- a/monasca_log_api/policies/healthchecks.py +++ b/monasca_log_api/policies/healthchecks.py @@ -26,7 +26,7 @@ rules = [ check_str=CHECK_AUTHORIZED_ROLES, description='Healthcheck head rule', operations=[ - {'path': '/', 'method': 'HEAD'} + {'path': '/healthcheck', 'method': 'HEAD'} ] ), policy.DocumentedRuleDefault( @@ -34,7 +34,7 @@ rules = [ check_str=CHECK_AUTHORIZED_ROLES, description='Healthcheck get rule', operations=[ - {'path': '/', 'method': 'GET'} + {'path': '/healthcheck', 'method': 'GET'} ] ), ]