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

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

ndg.security.server/ndg/security/server/SessionMgr/server-config.tac:

  • soap_disconnect: added call to SessionMgr?.disconnect, added logic for retrieving ID from cert.

used with WS-Security signature.

  • add code to check for useSignatureHandler config param. If this flag is set, get user ID from

cert in WS-Security header

ndg.security.test/ndg/security/test/SessionMgr/sessionMgrProperties.xml,
ndg.security.server/ndg/security/server/SessionMgr/init.py: added "useSignatureHandler" parameter
to properties file elements.

www/html/sessionMgr.wsdl,
ndg.security.server/ndg/security/server/SessionMgr/SessionMgr_services_server.py,
ndg.security.common/ndg/security/common/SessionMgr/SessionMgr_services.py,
ndg.security.common/ndg/security/common/SessionMgr/SessionMgr_services_types.py: removed userCert
argument. - This is not needed as cert chain can be passed in by setting #X509PKIPathv1 for
BinarySecurityToken?.

ndg.security.client/ndg/security/client/ndgSessionClient.py: started on updates from alpha version -
--req-autho flag is now --req-attr

ndg.security.test/ndg/security/test/AttCert/attCertTest.cfg,
ndg.security.test/ndg/security/test/AttCert/attCertTest.cfg: added more tests for signature
verification tests.

ndg.security.test/ndg/security/test/SessionMgr/SessionMgrClientTest.py: removed userCert arg from
disconnect call. It's passed in the signature in the WS-Security header.

ndg.security.common/ndg/security/common/XMLSec.py: fixed bug in applyEnvelopedSignature - removed
incorrect strip call from digest calc:

calcSignedInfoDigestValue = sha(signedInfoC14n).digest()#.strip()


ndg.security.common/ndg/security/common/SessionMgr/init.py: Session Manager client code -
remove refs to "userCert" for disconnect and connect calls. It's passed in the WS-Security header
instead.

ndg.security.common/ndg/security/common/wsSecurity.py: comment - query whitespace strip in
extraction of calculated signature value from message "b64EncSignatureValue".

  • 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 0x406c062c>
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 0x406c092c>
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 0x406c762c>
66    def disconnect(self, sessID,encrSessionMgrURI):
67
68        request = disconnectInputMsg()
69        request._sessID = sessID
70        request._encrSessionMgrURI = encrSessionMgrURI
71
72        kw = {}
73        # no input wsaction
74        self.binding.Send(None, None, request, soapaction="disconnect", **kw)
75        # no output wsaction
76        response = self.binding.Receive(disconnectOutputMsg.typecode)
77        return 
78
79    # op: <ZSI.wstools.WSDLTools.Message instance at 0x406c77cc>
80    def getAttCert(self, userCert,sessID,encrSessionMgrURI,attAuthorityURI,attAuthorityCert,reqRole,mapFromTrustedHosts,rtnExtAttCertList,extAttCert,extTrustedHost):
81
82        request = getAttCertInputMsg()
83        request._userCert = userCert
84        request._sessID = sessID
85        request._encrSessionMgrURI = encrSessionMgrURI
86        request._attAuthorityURI = attAuthorityURI
87        request._attAuthorityCert = attAuthorityCert
88        request._reqRole = reqRole
89        request._mapFromTrustedHosts = mapFromTrustedHosts
90        request._rtnExtAttCertList = rtnExtAttCertList
91        request._extAttCert = extAttCert
92        request._extTrustedHost = extTrustedHost
93
94        kw = {}
95        # no input wsaction
96        self.binding.Send(None, None, request, soapaction="getAttCert", **kw)
97        # no output wsaction
98        response = self.binding.Receive(getAttCertOutputMsg.typecode)
99        attCert = response._attCert
100        msg = response._msg
101        extAttCertOut = response._extAttCertOut
102        return attCert,msg,extAttCertOut
103
104    # op: <ZSI.wstools.WSDLTools.Message instance at 0x406c794c>
105    def getX509Cert(self):
106
107        request = getX509CertInputMsg()
108
109        kw = {}
110        # no input wsaction
111        self.binding.Send(None, None, request, soapaction="getX509Cert", **kw)
112        # no output wsaction
113        response = self.binding.Receive(getX509CertOutputMsg.typecode)
114        x509Cert = response._x509Cert
115        return x509Cert
116
117addUserInputMsg = ns0.addUser_Dec().pyclass
118
119addUserOutputMsg = ns0.addUserResponse_Dec().pyclass
120
121connectInputMsg = ns0.connect_Dec().pyclass
122
123connectOutputMsg = ns0.connectResponse_Dec().pyclass
124
125disconnectInputMsg = ns0.disconnect_Dec().pyclass
126
127disconnectOutputMsg = ns0.disconnectResponse_Dec().pyclass
128
129getAttCertInputMsg = ns0.getAttCert_Dec().pyclass
130
131getAttCertOutputMsg = ns0.getAttCertResponse_Dec().pyclass
132
133getX509CertInputMsg = ns0.getX509Cert_Dec().pyclass
134
135getX509CertOutputMsg = ns0.getX509CertResponse_Dec().pyclass
Note: See TracBrowser for help on using the repository browser.