source: TI12-security/trunk/python/ndg.security.common/ndg/security/common/zsi/attributeauthority/AttributeAuthority_services.py @ 4713

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.common/ndg/security/common/zsi/attributeauthority/AttributeAuthority_services.py@4713
Revision 4713, 3.7 KB checked in by pjkersha, 11 years ago (diff)

Added extra parameter 'siteName' to Attribute Authority map configuration to enable display of a more user friendly listing in the WAYF.

  • re-ran all attribute authority related unit tests
  • TODO: modify and test SSO client WAYF interface to use new param
Line 
1##################################################
2# AttributeAuthority_services.py
3# generated by ZSI.generate.wsdl2python
4##################################################
5
6
7from AttributeAuthority_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 AttributeAuthorityServiceLocator:
16    AttributeAuthority_address = "http://localhost:5000"
17    def getAttributeAuthorityAddress(self):
18        return AttributeAuthorityServiceLocator.AttributeAuthority_address
19    def getAttributeAuthority(self, url=None, **kw):
20        return AttributeAuthorityBindingSOAP(url or AttributeAuthorityServiceLocator.AttributeAuthority_address, **kw)
21
22# Methods
23class AttributeAuthorityBindingSOAP:
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 0x84cad2c>
32    def getAttCert(self, userId,userX509Cert,userAttCert):
33
34        request = getAttCertInputMsg()
35        request._userId = userId
36        request._userX509Cert = userX509Cert
37        request._userAttCert = userAttCert
38
39        kw = {}
40        # no input wsaction
41        self.binding.Send(None, None, request, soapaction="getAttCert", **kw)
42        # no output wsaction
43        response = self.binding.Receive(getAttCertOutputMsg.typecode)
44        attCert = response._attCert
45        msg = response._msg
46        return attCert,msg
47
48    # op: <ZSI.wstools.WSDLTools.Message instance at 0x84d106c>
49    def getHostInfo(self):
50
51        request = getHostInfoInputMsg()
52
53        kw = {}
54        # no input wsaction
55        self.binding.Send(None, None, request, soapaction="getHostInfo", **kw)
56        # no output wsaction
57        response = self.binding.Receive(getHostInfoOutputMsg.typecode)
58        hostname = response._hostname
59        siteName = response._siteName
60        aaURI = response._aaURI
61        aaDN = response._aaDN
62        loginURI = response._loginURI
63        loginServerDN = response._loginServerDN
64        loginRequestServerDN = response._loginRequestServerDN
65        return hostname,siteName,aaURI,aaDN,loginURI,loginServerDN,loginRequestServerDN
66
67    # op: <ZSI.wstools.WSDLTools.Message instance at 0x84d1c0c>
68    def getTrustedHostInfo(self, role):
69
70        request = getTrustedHostInfoInputMsg()
71        request._role = role
72
73        kw = {}
74        # no input wsaction
75        self.binding.Send(None, None, request, soapaction="getTrustedHostInfo", **kw)
76        # no output wsaction
77        response = self.binding.Receive(getTrustedHostInfoOutputMsg.typecode)
78        trustedHosts = response._trustedHosts
79        return trustedHosts
80
81    # op: <ZSI.wstools.WSDLTools.Message instance at 0x84d1d8c>
82    def getAllHostsInfo(self):
83
84        request = getAllHostsInfoInputMsg()
85
86        kw = {}
87        # no input wsaction
88        self.binding.Send(None, None, request, soapaction="getAllHostsInfo", **kw)
89        # no output wsaction
90        response = self.binding.Receive(getAllHostsInfoOutputMsg.typecode)
91        hosts = response._hosts
92        return hosts
93
94getAttCertInputMsg = ns0.getAttCert_Dec().pyclass
95
96getAttCertOutputMsg = ns0.getAttCertResponse_Dec().pyclass
97
98getHostInfoInputMsg = ns0.getHostInfo_Dec().pyclass
99
100getHostInfoOutputMsg = ns0.getHostInfoResponse_Dec().pyclass
101
102getTrustedHostInfoInputMsg = ns0.getTrustedHostInfo_Dec().pyclass
103
104getTrustedHostInfoOutputMsg = ns0.getTrustedHostInfoResponse_Dec().pyclass
105
106getAllHostsInfoInputMsg = ns0.getAllHostsInfo_Dec().pyclass
107
108getAllHostsInfoOutputMsg = ns0.getAllHostsInfoResponse_Dec().pyclass
Note: See TracBrowser for help on using the repository browser.