You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@milagro.apache.org by sa...@apache.org on 2016/08/15 11:23:42 UTC

[5/9] incubator-milagro-mfa-server git commit: Fix shebang, make service options dynamic

Fix shebang, make service options dynamic


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-server/commit/a593b917
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-server/tree/a593b917
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-server/diff/a593b917

Branch: refs/heads/master
Commit: a593b91769abac09a68f47a0e5811357a309a4c3
Parents: 2dfaec0
Author: Milen Rangelov <mi...@miracl.com>
Authored: Fri Jun 10 16:22:08 2016 +0300
Committer: Milen Rangelov <mi...@miracl.com>
Committed: Fri Jun 10 16:22:08 2016 +0300

----------------------------------------------------------------------
 servers/rps/rps.py | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-server/blob/a593b917/servers/rps/rps.py
----------------------------------------------------------------------
diff --git a/servers/rps/rps.py b/servers/rps/rps.py
index 81aace9..1f8f115 100755
--- a/servers/rps/rps.py
+++ b/servers/rps/rps.py
@@ -1,4 +1,4 @@
-#!/usr/bin/en python
+#!/usr/bin/env python
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -130,6 +130,7 @@ define("setDeviceName", default=False, type=bool)
 # mobile client config
 define("mobileUseNative", default=False, type=bool)
 define("mobileConfig", default=None, type=list)
+define("mobileService", default=None, type=dict)
 define("useNFC", default=False, type=bool)
 define("serviceName", default="", type=unicode)
 define("serviceType", default="online", type=unicode)
@@ -144,6 +145,7 @@ DYNAMIC_OPTION_MAPPING = {
     'time_synchronization_period': 'timePeriod',
     'mobile_use_native': 'mobileUseNative',
     'mobile_client_config': 'mobileConfig',
+    'mobile_service': 'mobileService',
 }
 
 
@@ -858,15 +860,11 @@ class ServiceHandler(BaseHandler):
     @tornado.web.asynchronous
     @tornado.gen.engine
     def get(self):
-        params = {
-            "name": options.serviceName,
-            "url": options.rpsBaseURL,
-            "type": options.serviceType,
-            "rps_prefix": options.rpsPrefix,
-            "icon_url": options.serviceIconUrl,
-        }
-
-        self.write(params)
+        if options.mobileService:
+            params = str(options.mobileService)
+            self.write(params)
+        else:
+            self.set_status(403)
         self.finish()