source: TI12-security/trunk/python/ndg.security.common/ndg/security/common/AttAuthority/AttAuthority_services.py @ 2079

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.common/ndg/security/common/AttAuthority/AttAuthority_services.py@2079
Revision 2079, 3.3 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
Line 
1##################################################
2# AttAuthority_services.py
3# generated by ZSI.generate.wsdl2python
4##################################################
5
6
7from AttAuthority_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 AttAuthorityServiceLocator:
16    AttAuthority_address = "http://localhost:5700"
17    def getAttAuthorityAddress(self):
18        return AttAuthorityServiceLocator.AttAuthority_address
19    def getAttAuthority(self, url=None, **kw):
20        return AttAuthorityBindingSOAP(url or AttAuthorityServiceLocator.AttAuthority_address, **kw)
21
22# Methods
23class AttAuthorityBindingSOAP:
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 0xb6cf422c>
32    def getAttCert(self, userCert,userAttCert):
33
34        request = getAttCertInputMsg()
35        request._userCert = userCert
36        request._userAttCert = userAttCert
37
38        kw = {}
39        # no input wsaction
40        self.binding.Send(None, None, request, soapaction="getAttCert", **kw)
41        # no output wsaction
42        response = self.binding.Receive(getAttCertOutputMsg.typecode)
43        attCert = response._attCert
44        return attCert
45
46    # op: <ZSI.wstools.WSDLTools.Message instance at 0xb6cf454c>
47    def getHostInfo(self):
48
49        request = getHostInfoInputMsg()
50
51        kw = {}
52        # no input wsaction
53        self.binding.Send(None, None, request, soapaction="getHostInfo", **kw)
54        # no output wsaction
55        response = self.binding.Receive(getHostInfoOutputMsg.typecode)
56        hostname = response._hostname
57        aaURI = response._aaURI
58        loginURI = response._loginURI
59        return hostname,aaURI,loginURI
60
61    # op: <ZSI.wstools.WSDLTools.Message instance at 0xb6cf4e6c>
62    def getTrustedHostInfo(self, role):
63
64        request = getTrustedHostInfoInputMsg()
65        request._role = role
66
67        kw = {}
68        # no input wsaction
69        self.binding.Send(None, None, request, soapaction="getTrustedHostInfo", **kw)
70        # no output wsaction
71        response = self.binding.Receive(getTrustedHostInfoOutputMsg.typecode)
72        trustedHosts = response._trustedHosts
73        return trustedHosts
74
75    # op: <ZSI.wstools.WSDLTools.Message instance at 0xb6cf4fec>
76    def getX509Cert(self):
77
78        request = getX509CertInputMsg()
79
80        kw = {}
81        # no input wsaction
82        self.binding.Send(None, None, request, soapaction="getX509Cert", **kw)
83        # no output wsaction
84        response = self.binding.Receive(getX509CertOutputMsg.typecode)
85        x509Cert = response._x509Cert
86        return x509Cert
87
88getAttCertInputMsg = ns0.getAttCert_Dec().pyclass
89
90getAttCertOutputMsg = ns0.getAttCertResponse_Dec().pyclass
91
92getHostInfoInputMsg = ns0.getHostInfo_Dec().pyclass
93
94getHostInfoOutputMsg = ns0.getHostInfoResponse_Dec().pyclass
95
96getTrustedHostInfoInputMsg = ns0.getTrustedHostInfo_Dec().pyclass
97
98getTrustedHostInfoOutputMsg = ns0.getTrustedHostInfoResponse_Dec().pyclass
99
100getX509CertInputMsg = ns0.getX509Cert_Dec().pyclass
101
102getX509CertOutputMsg = ns0.getX509CertResponse_Dec().pyclass
Note: See TracBrowser for help on using the repository browser.