--- /dev/null
+********** requirements
+requires cherrypy 3.x:
+. available in f14 with
+yum install python-cherrypy
+. available in macos with
+sudo port install py26-cherrypy3
+
+note that running https requires the OpenSSL module as well
+. f14
+yum install pyOpenSSL
+. macos
+???
+
+********** SSL
+on my devel box I created a fake cert using
+. openssl req -new -x509 -days 120 -set_serial $RANDOM -batch -subj "/CN=zankai.inria.fr" -nodes -keyout zankai.key -out zankai.crt
+
+worked like a charm
+
+********** xmlrpc
+http://www.cherrypy.org/wiki/BuiltinTools#tools.xmlrpc
+http://tools.cherrypy.org/wiki/XmlRpcIntrospection
--- /dev/null
+import cherrypy
+
+interface_version='0.0'
+
+class OnelabSingleSignOn (cherrypy._cptools.XMLRPCController):
+ def version (self):
+ return interface_version
+ version.exposed=True
+
+ # basically this goes at several places to see if this user is known
+ # first sequential implementation should be ok for our needs
+ # given that we'd have only 2 places to check
+ # details of the return structure to be specified
+ def AuthCheck (self, login, password):
+ return { 'alt': "not implemented yet", }
+ AuthCheck.exposed=True
+
--- /dev/null
+#!/usr/bin/env python
+
+import xmlrpclib
+import traceback
+
+url="https://localhost:9999/xmlrpc"
+try:
+ server = xmlrpclib.Server(url)
+ print url,'get version',server.version()
+ print url,'AuthCheck',server.AuthCheck("john.doe@foo.com","weirdpassword")
+except:
+ print 'something wrong with url=',url
+ traceback.print_exc()
--- /dev/null
+#!/usr/bin/env python
+
+import cherrypy
+
+from OnelabSingleSignOn import OnelabSingleSignOn
+
+interface_path='/xmlrpc'
+mydir="/Users/parmentelat/git/infrastructure/onelab-sso/"
+
+cherrypy.tree.mount(OnelabSingleSignOn(), interface_path)
+
+tweaks={'xmlrpc_filter.on':True,
+ 'request.dispatch': cherrypy.dispatch.XMLRPCDispatcher(),
+ }
+
+cherrypy.config.update( {interface_path: tweaks})
+
+cherrypy.server.socket_host= '0.0.0.0'
+cherrypy.server.socket_port= 9999
+cherrypy.server.ssl_certificate= mydir+"zankai.crt"
+cherrypy.server.ssl_private_key= mydir+"zankai.key"
+
+cherrypy.server.start()