From cbc096f9cb44a7d26b4fa01a40dbba594ab339ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Thu, 15 Oct 2015 15:09:00 +0200 Subject: Implemented minimum support for authentication via SAML with an addition of a new daemon. TODO: python login with SAML credentials. --- server/handlers.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/handlers.py b/server/handlers.py index 5439d19..93818f0 100644 --- a/server/handlers.py +++ b/server/handlers.py @@ -276,13 +276,21 @@ class EndProblem(CodeqService): request.end() - class GetUserStat(CodeqService): def process(self, request): stat = request.session.get_stat() request.reply({'code': 0, 'stat': stat}) +class SamlLogin(CodeqService): + def process(self, request): + data = request.data.get('data') + if data is None: + request.reply({'code': 1, 'message': 'SAML user data not specified'}) + else: + request.reply({'code': 0, 'message': 'OK'}) # TODO: implement login using SAML credentials + + # maps actions to their handlers incoming_handlers = { 'create_session': CreateSession(), @@ -301,7 +309,8 @@ incoming_handlers = { 'test': Test(), 'load_problem': LoadProblem(), 'end_problem': EndProblem(), - 'user_stat': GetUserStat() + 'user_stat': GetUserStat(), + 'saml_login': SamlLogin() } -- cgit v1.2.1