summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorAleš Smodiš <aless@guru.si>2015-10-15 15:09:00 +0200
committerAleš Smodiš <aless@guru.si>2015-10-15 15:09:00 +0200
commitcbc096f9cb44a7d26b4fa01a40dbba594ab339ca (patch)
tree3079dbaf60e7e60d643e66d013fc52d155eaa095 /server
parentc8c4ca123d24757d3d3537817ba2a40849b3ca2c (diff)
Implemented minimum support for authentication via SAML with an addition of a new daemon.
TODO: python login with SAML credentials.
Diffstat (limited to 'server')
-rw-r--r--server/handlers.py13
1 files changed, 11 insertions, 2 deletions
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()
}