source: TI12-security/trunk/python/ndg.security.common/ndg/security/common/SessionMgr/SessionMgr_services.py @ 2079

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.common/ndg/security/common/SessionMgr/SessionMgr_services.py@2079
Revision 2079, 4.7 KB checked in by pjkersha, 13 years ago (diff)

python/www/html/attAuthority.wsdl,
python/ndg.security.server/ndg/security/server/AttAuthority/AttAuthority_services_server.py,
python/ndg.security.common/ndg/security/common/AttAuthority/AttAuthority_services_types.py,
python/ndg.security.common/ndg/security/common/AttAuthority/AttAuthority_services.py,
python/www/html/sessionMgr.wsdl,
python/ndg.security.server/ndg/security/server/SessionMgr/SessionMgr_services_server.p
y,
python/ndg.security.common/ndg/security/common/SessionMgr/SessionMgr_services.py,
python/ndg.security.common/ndg/security/common/SessionMgr/SessionMgr_services_types.py:
Make separate schema for the two services - urn:ndg:security:attAuthority and
urn:ndg:security:sessionMgr otherwise getAttCert and getAttCertResponse declarations
get mixed up between the two in the ZSI code.

python/ndg.security.server/ndg/security/server/SessionMgr/server-config.tac:
replace get_element_* and set_element_* with attributes references instead e.g.
request.get_element_username() -> request.Username

python/ndg.security.server/ndg/security/server/SessionMgr/init.py:

  • rename encrypt and decrypt static UserSession? methods encodeSessionMgrURI and

decodeSessionMgrURI respectively. The encryption key is now optional and isn't applied
if omitted. This means that Session Manager URI in the cookie can be base 64 encoded only
and not encrypted.

  • getAttCert - simplified use of keywords in input and call to CredWallet?.getAttCert
  • fixes to redirectAttCertReq for correct SessionMgrClient? call - needs test

python/ndg.security.common/ndg/security/common/CredWallet.py:

  • fix AttAuthorityClient? import
  • remove clnt* properties - use proxy settings instead for signing requests to AA
  • fixes to getAttCert and getAttCert calls
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1##################################################
2# SessionMgr_services.py
3# generated by ZSI.generate.wsdl2python
4##################################################
5
6
7from SessionMgr_services_types import *
8import urlparse, types
9from ZSI.TCcompound import ComplexType, Struct
10from ZSI import client
11import ZSI
12from ZSI.generate.pyclass import pyclass_type
13
14# Locator
15class SessionMgrServiceLocator:
16    SessionMgr_address = "http://localhost:5000"
17    def getSessionMgrAddress(self):
18        return SessionMgrServiceLocator.SessionMgr_address
19    def getSessionMgr(self, url=None, **kw):
20        return SessionMgrBindingSOAP(url or SessionMgrServiceLocator.SessionMgr_address, **kw)
21
22# Methods
23class SessionMgrBindingSOAP:
24    def __init__(self, url, **kw):
25        kw.setdefault("readerclass", None)
26        kw.setdefault("writerclass", None)
27        # no resource properties
28        self.binding = client.Binding(url=url, **kw)
29        # no ws-addressing
30
31    # op: <ZSI.wstools.WSDLTools.Message instance at 0xb6cff52c>
32    def addUser(self, username,passphrase):
33
34        request = addUserInputMsg()
35        request._username = username
36        request._passphrase = passphrase
37
38        kw = {}
39        # no input wsaction
40        self.binding.Send(None, None, request, soapaction="addUser", **kw)
41        # no output wsaction
42        response = self.binding.Receive(addUserOutputMsg.typecode)
43        return 
44
45    # op: <ZSI.wstools.WSDLTools.Message instance at 0xb6cff82c>
46    def connect(self, username,passphrase,createServerSess,getCookie):
47
48        request = connectInputMsg()
49        request._username = username
50        request._passphrase = passphrase
51        request._createServerSess = createServerSess
52        request._getCookie = getCookie
53
54        kw = {}
55        # no input wsaction
56        self.binding.Send(None, None, request, soapaction="connect", **kw)
57        # no output wsaction
58        response = self.binding.Receive(connectOutputMsg.typecode)
59        proxyCert = response._proxyCert
60        proxyPriKey = response._proxyPriKey
61        userCert = response._userCert
62        cookie = response._cookie
63        return proxyCert,proxyPriKey,userCert,cookie
64
65    # op: <ZSI.wstools.WSDLTools.Message instance at 0xb6d0758c>
66    def disconnect(self, userCert,sessID,encrSessionMgrURI):
67
68        request = disconnectInputMsg()
69        request._userCert = userCert
70        request._sessID = sessID
71        request._encrSessionMgrURI = encrSessionMgrURI
72
73        kw = {}
74        # no input wsaction
75        self.binding.Send(None, None, request, soapaction="disconnect", **kw)
76        # no output wsaction
77        response = self.binding.Receive(disconnectOutputMsg.typecode)
78        return 
79
80    # op: <ZSI.wstools.WSDLTools.Message instance at 0xb6d0772c>
81    def getAttCert(self, userCert,sessID,encrSessionMgrURI,attAuthorityURI,attAuthorityCert,reqRole,mapFromTrustedHosts,rtnExtAttCertList,extAttCert,extTrustedHost):
82
83        request = getAttCertInputMsg()
84        request._userCert = userCert
85        request._sessID = sessID
86        request._encrSessionMgrURI = encrSessionMgrURI
87        request._attAuthorityURI = attAuthorityURI
88        request._attAuthorityCert = attAuthorityCert
89        request._reqRole = reqRole
90        request._mapFromTrustedHosts = mapFromTrustedHosts
91        request._rtnExtAttCertList = rtnExtAttCertList
92        request._extAttCert = extAttCert
93        request._extTrustedHost = extTrustedHost
94
95        kw = {}
96        # no input wsaction
97        self.binding.Send(None, None, request, soapaction="getAttCert", **kw)
98        # no output wsaction
99        response = self.binding.Receive(getAttCertOutputMsg.typecode)
100        attCert = response._attCert
101        statusCode = response._statusCode
102        msg = response._msg
103        extAttCert = response._extAttCert
104        return attCert,statusCode,msg,extAttCert
105
106    # op: <ZSI.wstools.WSDLTools.Message instance at 0xb6d078ac>
107    def getX509Cert(self):
108
109        request = getX509CertInputMsg()
110
111        kw = {}
112        # no input wsaction
113        self.binding.Send(None, None, request, soapaction="getX509Cert", **kw)
114        # no output wsaction
115        response = self.binding.Receive(getX509CertOutputMsg.typecode)
116        x509Cert = response._x509Cert
117        return x509Cert
118
119addUserInputMsg = ns0.addUser_Dec().pyclass
120
121addUserOutputMsg = ns0.addUserResponse_Dec().pyclass
122
123connectInputMsg = ns0.connect_Dec().pyclass
124
125connectOutputMsg = ns0.connectResponse_Dec().pyclass
126
127disconnectInputMsg = ns0.disconnect_Dec().pyclass
128
129disconnectOutputMsg = ns0.disconnectResponse_Dec().pyclass
130
131getAttCertInputMsg = ns0.getAttCert_Dec().pyclass
132
133getAttCertOutputMsg = ns0.getAttCertResponse_Dec().pyclass
134
135getX509CertInputMsg = ns0.getX509Cert_Dec().pyclass
136
137getX509CertOutputMsg = ns0.getX509CertResponse_Dec().pyclass
Note: See TracBrowser for help on using the repository browser.