aboutsummaryrefslogtreecommitdiffstats
path: root/moon_interface
diff options
context:
space:
mode:
Diffstat (limited to 'moon_interface')
-rw-r--r--moon_interface/moon_interface/authz_requests.py2
-rw-r--r--moon_interface/moon_interface/http_server.py6
-rw-r--r--moon_interface/moon_interface/server.py8
3 files changed, 3 insertions, 13 deletions
diff --git a/moon_interface/moon_interface/authz_requests.py b/moon_interface/moon_interface/authz_requests.py
index 12c190c7..2ef0e0a1 100644
--- a/moon_interface/moon_interface/authz_requests.py
+++ b/moon_interface/moon_interface/authz_requests.py
@@ -33,7 +33,7 @@ class AuthzRequest:
raise exceptions.KeystoneProjectError("Unknown Project ID {}".format(ctx['project_id']))
self.container_chaining = CACHE.container_chaining[ctx['project_id']]
- if len(self.container_chaining) == 0 or not all(k in self.container_data for k in ("container_id", "hostname", "hostip", "port")):
+ if len(self.container_chaining) == 0 or not all(k in self.container_chaining[0] for k in ("container_id", "hostname", "hostip", "port")):
raise exceptions.MoonError('Void container chaining')
self.pdp_container = self.container_chaining[0]["container_id"]
diff --git a/moon_interface/moon_interface/http_server.py b/moon_interface/moon_interface/http_server.py
index 82ee5d91..a2e25377 100644
--- a/moon_interface/moon_interface/http_server.py
+++ b/moon_interface/moon_interface/http_server.py
@@ -114,12 +114,6 @@ class HTTPServer(Server):
def get_400_json(e):
return jsonify({"result": False, "code": 400, "description": str(e)}), 400
- '''
- [Note] i have tried to simulate authz post request (authz_Requests/run) to return 500 response code
- and an AuthzException thrown from their [Line 63] and catched here , then the server here return response
- with 403 code [Forbidden] , is it correct if so why sometime at authz [from Line 137] return a response
- with error code , i think we can do it in the same way as the one mentioned?
- '''
self.app.register_error_handler(400, lambda e: get_400_json)
self.app.register_error_handler(403, exceptions.AuthException)
diff --git a/moon_interface/moon_interface/server.py b/moon_interface/moon_interface/server.py
index d38dae28..29403a6b 100644
--- a/moon_interface/moon_interface/server.py
+++ b/moon_interface/moon_interface/server.py
@@ -16,9 +16,7 @@ def create_server():
conf = configuration.get_configuration("components/pipeline").get(
"components/pipeline", {}).get("interface", {})
- '''
- [Note] i think pipeline should be changed to interface
- '''
+
hostname = conf.get("hostname", "pipeline")
port = conf.get("port", 80)
bind = conf.get("bind", "127.0.0.1")
@@ -26,9 +24,7 @@ def create_server():
hostname = "interface"
bind = "127.0.0.1"
port = 80
- '''
- [Note] i think pipeline should be changed to interface
- '''
+
configuration.add_component(uuid="pipeline",
name=hostname,
port=port,