source: TI12-security/trunk/python/ndg.security.server/ndg/security/server/zsi/attributeauthority/AttributeAuthority_services_server.py @ 4513

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.server/ndg/security/server/zsi/attributeauthority/AttributeAuthority_services_server.py@4513
Revision 4513, 13.0 KB checked in by pjkersha, 12 years ago (diff)

Added local Session Manager call test to combined services unit tests.

Line 
1##################################################
2# AttributeAuthority_services_server.py
3#      Generated by ZSI.generate.wsdl2dispatch.DelAuthServiceModuleWriter
4#
5##################################################
6
7from ndg.security.common.zsi.attributeauthority.AttributeAuthority_services import *
8from ZSI.ServiceContainer import ServiceSOAPBinding
9
10class AttributeAuthorityService(ServiceSOAPBinding):
11    soapAction = {}
12    root = {}
13    _wsdl = """<?xml version=\"1.0\" ?>
14<wsdl:definitions name=\"AttributeAuthority\" targetNamespace=\"urn:ndg:security:AttributeAuthority\" xmlns=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:http=\"http://schemas.xmlsoap.org/wsdl/http/\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:tns=\"urn:ndg:security:AttributeAuthority\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">
15
16  <wsdl:types>
17    <xsd:schema targetNamespace=\"urn:ndg:security:AttributeAuthority\">
18   
19      <xsd:complexType name=\"HostInfo\">
20        <xsd:sequence>
21          <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"hostname\" type=\"xsd:string\"/>
22          <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"aaURI\" type=\"xsd:string\"/>
23          <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"aaDN\" type=\"xsd:string\"/>
24          <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"loginURI\" type=\"xsd:string\"/>
25          <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"loginServerDN\" type=\"xsd:string\"/>
26          <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"loginRequestServerDN\" type=\"xsd:string\"/>
27          <xsd:element maxOccurs=\"unbounded\" minOccurs=\"0\" name=\"roleList\" type=\"xsd:string\"/>
28        </xsd:sequence>
29      </xsd:complexType>
30     
31      <xsd:element name=\"getAttCert\">
32        <xsd:complexType>
33          <xsd:sequence>
34            <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"userId\" type=\"xsd:string\"/>
35            <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"userX509Cert\" type=\"xsd:string\"/>
36            <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"userAttCert\" type=\"xsd:string\"/>
37          </xsd:sequence>
38        </xsd:complexType>
39      </xsd:element>
40     
41      <xsd:element name=\"getAttCertResponse\">
42        <xsd:complexType>
43          <xsd:sequence>
44            <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"attCert\" type=\"xsd:string\"/>
45                <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"msg\" type=\"xsd:string\"/>
46          </xsd:sequence>
47        </xsd:complexType>
48      </xsd:element>
49
50      <xsd:element name=\"getHostInfo\">
51        <xsd:complexType/>
52      </xsd:element>
53
54      <xsd:element name=\"getHostInfoResponse\">
55        <xsd:complexType>
56          <xsd:sequence>
57            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"hostname\" type=\"xsd:string\"/>
58            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"aaURI\" type=\"xsd:string\"/>
59            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"aaDN\" type=\"xsd:string\"/>
60            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"loginURI\" type=\"xsd:string\"/>
61            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"loginServerDN\" type=\"xsd:string\"/>
62            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"loginRequestServerDN\" type=\"xsd:string\"/>
63          </xsd:sequence>
64        </xsd:complexType>
65      </xsd:element>
66
67      <xsd:element name=\"getTrustedHostInfo\">
68        <xsd:complexType>
69          <xsd:sequence>
70            <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"role\" type=\"xsd:string\"/>
71          </xsd:sequence>
72        </xsd:complexType>
73      </xsd:element>
74
75      <xsd:element name=\"getTrustedHostInfoResponse\">
76        <xsd:complexType>
77          <xsd:sequence>
78            <xsd:element maxOccurs=\"unbounded\" minOccurs=\"0\" name=\"trustedHosts\" type=\"tns:HostInfo\"/>
79          </xsd:sequence>
80        </xsd:complexType>
81      </xsd:element>
82
83      <xsd:element name=\"getAllHostsInfo\">
84        <xsd:complexType/>
85      </xsd:element>
86
87      <xsd:element name=\"getAllHostsInfoResponse\">
88        <xsd:complexType>
89          <xsd:sequence>
90            <xsd:element maxOccurs=\"unbounded\" minOccurs=\"0\" name=\"hosts\" type=\"tns:HostInfo\"/>
91          </xsd:sequence>
92        </xsd:complexType>
93      </xsd:element>
94
95      <xsd:element name=\"getX509Cert\">
96        <xsd:complexType/>
97      </xsd:element>
98     
99      <xsd:element name=\"getX509CertResponse\">
100        <xsd:complexType>
101          <xsd:sequence>
102            <xsd:element maxOccurs=\"1\" minOccurs=\"1\" name=\"x509Cert\" type=\"xsd:string\"/>
103          </xsd:sequence>
104        </xsd:complexType>
105      </xsd:element>
106
107    </xsd:schema>
108  </wsdl:types>
109 
110  <wsdl:message name=\"getAttCertInputMsg\">
111    <wsdl:part element=\"tns:getAttCert\" name=\"parameters\"/>
112  </wsdl:message>
113
114  <wsdl:message name=\"getAttCertOutputMsg\">
115    <wsdl:part element=\"tns:getAttCertResponse\" name=\"parameters\"/>
116  </wsdl:message>
117 
118  <wsdl:message name=\"getHostInfoInputMsg\">
119    <wsdl:part element=\"tns:getHostInfo\" name=\"parameters\"/>
120  </wsdl:message>
121
122  <wsdl:message name=\"getHostInfoOutputMsg\">
123    <wsdl:part element=\"tns:getHostInfoResponse\" name=\"parameters\"/>
124  </wsdl:message>
125
126  <wsdl:message name=\"getTrustedHostInfoInputMsg\">
127    <wsdl:part element=\"tns:getTrustedHostInfo\" name=\"parameters\"/>
128  </wsdl:message>
129
130  <wsdl:message name=\"getTrustedHostInfoOutputMsg\">
131    <wsdl:part element=\"tns:getTrustedHostInfoResponse\" name=\"parameters\"/>
132  </wsdl:message>
133
134  <wsdl:message name=\"getAllHostsInfoInputMsg\">
135    <wsdl:part element=\"tns:getAllHostsInfo\" name=\"parameters\"/>
136  </wsdl:message>
137
138  <wsdl:message name=\"getAllHostsInfoOutputMsg\">
139    <wsdl:part element=\"tns:getAllHostsInfoResponse\" name=\"parameters\"/>
140  </wsdl:message>
141
142  <wsdl:message name=\"getX509CertInputMsg\">
143    <wsdl:part element=\"tns:getX509Cert\" name=\"parameters\"/>
144  </wsdl:message>
145
146  <wsdl:message name=\"getX509CertOutputMsg\">
147    <wsdl:part element=\"tns:getX509CertResponse\" name=\"parameters\"/>
148  </wsdl:message>
149
150  <wsdl:portType name=\"AttributeAuthority\">
151    <wsdl:operation name=\"getAttCert\">
152      <wsdl:input message=\"tns:getAttCertInputMsg\"/>
153      <wsdl:output message=\"tns:getAttCertOutputMsg\"/>
154    </wsdl:operation>
155
156    <wsdl:operation name=\"getHostInfo\">
157      <wsdl:input message=\"tns:getHostInfoInputMsg\"/>
158      <wsdl:output message=\"tns:getHostInfoOutputMsg\"/>
159    </wsdl:operation>
160
161    <wsdl:operation name=\"getTrustedHostInfo\">
162      <wsdl:input message=\"tns:getTrustedHostInfoInputMsg\"/>
163      <wsdl:output message=\"tns:getTrustedHostInfoOutputMsg\"/>
164    </wsdl:operation>
165
166    <wsdl:operation name=\"getAllHostsInfo\">
167      <wsdl:input message=\"tns:getAllHostsInfoInputMsg\"/>
168      <wsdl:output message=\"tns:getAllHostsInfoOutputMsg\"/>
169    </wsdl:operation>
170
171    <wsdl:operation name=\"getX509Cert\">
172      <wsdl:input message=\"tns:getX509CertInputMsg\"/>
173      <wsdl:output message=\"tns:getX509CertOutputMsg\"/>
174    </wsdl:operation>
175  </wsdl:portType>
176
177  <wsdl:binding name=\"AttributeAuthorityBinding\" type=\"tns:AttributeAuthority\">
178    <soap:binding style=\"document\" transport=\"http://schemas.xmlsoap.org/soap/http\"/>
179     
180    <wsdl:operation name=\"getAttCert\">
181      <soap:operation soapAction=\"getAttCert\"/>
182      <wsdl:input>
183        <soap:body use=\"literal\"/>
184      </wsdl:input>
185      <wsdl:output>
186        <soap:body use=\"literal\"/>
187      </wsdl:output>
188    </wsdl:operation>
189
190    <wsdl:operation name=\"getHostInfo\">
191      <soap:operation soapAction=\"getHostInfo\"/>
192      <wsdl:input>
193        <soap:body use=\"literal\"/>
194      </wsdl:input>
195      <wsdl:output>
196        <soap:body use=\"literal\"/>
197      </wsdl:output>
198    </wsdl:operation>
199
200    <wsdl:operation name=\"getTrustedHostInfo\">
201      <soap:operation soapAction=\"getTrustedHostInfo\"/>
202      <wsdl:input>
203        <soap:body use=\"literal\"/>
204      </wsdl:input>
205      <wsdl:output>
206        <soap:body use=\"literal\"/>
207      </wsdl:output>
208    </wsdl:operation>
209
210    <wsdl:operation name=\"getAllHostsInfo\">
211      <soap:operation soapAction=\"getAllHostsInfo\"/>
212      <wsdl:input>
213        <soap:body use=\"literal\"/>
214      </wsdl:input>
215      <wsdl:output>
216        <soap:body use=\"literal\"/>
217      </wsdl:output>
218    </wsdl:operation>
219
220    <wsdl:operation name=\"getX509Cert\">
221      <soap:operation soapAction=\"getX509Cert\"/>
222      <wsdl:input>
223        <soap:body use=\"literal\"/>
224      </wsdl:input>
225      <wsdl:output>
226        <soap:body use=\"literal\"/>
227      </wsdl:output>
228    </wsdl:operation>   
229 
230  </wsdl:binding>
231
232  <wsdl:service name=\"AttributeAuthorityService\">
233    <wsdl:documentation>NERC Data Grid Attribute Authority web service</wsdl:documentation>
234    <wsdl:port binding=\"tns:AttributeAuthorityBinding\" name=\"AttributeAuthority\">
235      <soap:address location=\"http://localhost:5000\"/>
236    </wsdl:port>
237  </wsdl:service>
238</wsdl:definitions>"""
239
240    def __init__(self, post='', **kw):
241        ServiceSOAPBinding.__init__(self, post)
242        if kw.has_key('impl'):
243            self.impl = kw['impl']
244        self.auth_method_name = None
245        if kw.has_key('auth_method_name'):
246            self.auth_method_name = kw['auth_method_name']
247    def authorize(self, auth_info, post, action):
248        if self.auth_method_name and hasattr(self.impl, self.auth_method_name):
249            return getattr(self.impl, self.auth_method_name)(auth_info, post, action)
250        else:
251            return 1
252
253    def soap_getAttCert(self, ps):
254        self.request = ps.Parse(getAttCertInputMsg.typecode)
255        parameters = (self.request._userId, self.request._userX509Cert, self.request._userAttCert)
256
257        # If we have an implementation object use it
258        if hasattr(self,'impl'):
259            parameters = self.impl.getAttCert(parameters[0],parameters[1],parameters[2])
260
261        result = getAttCertOutputMsg()
262        # If we have an implementation object, copy the result
263        if hasattr(self,'impl'):
264            # Should have a tuple of 2 args
265            result._attCert = parameters[0]
266            result._msg = parameters[1]
267        return result
268
269    soapAction['getAttCert'] = 'soap_getAttCert'
270    root[(getAttCertInputMsg.typecode.nspname,getAttCertInputMsg.typecode.pname)] = 'soap_getAttCert'
271
272    def soap_getHostInfo(self, ps):
273        self.request = ps.Parse(getHostInfoInputMsg.typecode)
274
275        # If we have an implementation object use it
276        if hasattr(self,'impl'):
277            parameters = self.impl.getHostInfo()
278
279        result = getHostInfoOutputMsg()
280        # If we have an implementation object, copy the result
281        if hasattr(self,'impl'):
282            # Should have a tuple of 6 args
283            result._hostname = parameters[0]
284            result._aaURI = parameters[1]
285            result._aaDN = parameters[2]
286            result._loginURI = parameters[3]
287            result._loginServerDN = parameters[4]
288            result._loginRequestServerDN = parameters[5]
289        return result
290
291    soapAction['getHostInfo'] = 'soap_getHostInfo'
292    root[(getHostInfoInputMsg.typecode.nspname,getHostInfoInputMsg.typecode.pname)] = 'soap_getHostInfo'
293
294    def soap_getTrustedHostInfo(self, ps):
295        self.request = ps.Parse(getTrustedHostInfoInputMsg.typecode)
296        parameters = self.request._role
297
298        # If we have an implementation object use it
299        if hasattr(self,'impl'):
300            parameters = self.impl.getTrustedHostInfo(parameters)
301
302        result = getTrustedHostInfoOutputMsg()
303        # If we have an implementation object, copy the result
304        if hasattr(self,'impl'):
305            result._trustedHosts = parameters
306        return result
307
308    soapAction['getTrustedHostInfo'] = 'soap_getTrustedHostInfo'
309    root[(getTrustedHostInfoInputMsg.typecode.nspname,getTrustedHostInfoInputMsg.typecode.pname)] = 'soap_getTrustedHostInfo'
310
311    def soap_getAllHostsInfo(self, ps):
312        self.request = ps.Parse(getAllHostsInfoInputMsg.typecode)
313
314        # If we have an implementation object use it
315        if hasattr(self,'impl'):
316            parameters = self.impl.getAllHostsInfo()
317
318        result = getAllHostsInfoOutputMsg()
319        # If we have an implementation object, copy the result
320        if hasattr(self,'impl'):
321            result._hosts = parameters
322        return result
323
324    soapAction['getAllHostsInfo'] = 'soap_getAllHostsInfo'
325    root[(getAllHostsInfoInputMsg.typecode.nspname,getAllHostsInfoInputMsg.typecode.pname)] = 'soap_getAllHostsInfo'
326
327    def soap_getX509Cert(self, ps):
328        self.request = ps.Parse(getX509CertInputMsg.typecode)
329
330        # If we have an implementation object use it
331        if hasattr(self,'impl'):
332            parameters = self.impl.getX509Cert()
333
334        result = getX509CertOutputMsg()
335        # If we have an implementation object, copy the result
336        if hasattr(self,'impl'):
337            result._x509Cert = parameters
338        return result
339
340    soapAction['getX509Cert'] = 'soap_getX509Cert'
341    root[(getX509CertInputMsg.typecode.nspname,getX509CertInputMsg.typecode.pname)] = 'soap_getX509Cert'
342
Note: See TracBrowser for help on using the repository browser.