From 82f404af0d3ad55e7c5596440efa96b8dc5e32f6 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Sun, 24 Apr 2016 10:48:16 +0000 Subject: [PATCH] Ipsilon API validate input Fixes: ticket #4923 Signed-off-by: Patrick Uiterwijk --- roles/ipsilon/files/api.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/ipsilon/files/api.py b/roles/ipsilon/files/api.py index dd0f8b05c0..f0ebb17efe 100644 --- a/roles/ipsilon/files/api.py +++ b/roles/ipsilon/files/api.py @@ -45,6 +45,14 @@ class APIV1Page(Page): return json.dumps(self._perform_call(kwargs)) def _perform_call(self, arguments): + required_arguments = ['auth_module', 'username', 'password'] + for arg in required_arguments: + if not arg in arguments: + return {'success': False, + 'status': 400, + 'message': 'Missing argument: %s' % arg + } + fas = self.root_obj.login.fas.lm openid = self.root_obj.openid