source: TI12-security/trunk/python/ndg.security.server/ndg/security/server/AttAuthority/server-config.tac @ 1724

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.server/ndg/security/server/AttAuthority/server-config.tac@1724
Revision 1724, 2.0 KB checked in by pjkersha, 14 years ago (diff)

Setting up client, server and unit tests for Attribute Authority.

Line 
1#!/usr/bin/env python
2"""NDG Security Attribute Authority .tac file
3
4This file enables the Attribute Authority web service to be
5called under the Twisted framework
6
7NERC Data Grid Project
8
9P J Kershaw 17/11/06
10
11Copyright (C) 2006 CCLRC & NERC
12
13This software may be distributed under the terms of the Q Public License,
14version 1.0 or later.
15"""
16#from AttAuthority_services_server import AttAuthorityService
17import AttAuthority_services_server as AttAuthorityServiceBase
18from ZSI.twisted.WSresource import WSResource
19from twisted.application import service, internet
20from twisted.web.server import Site
21from twisted.web.resource import Resource
22import socket
23
24class AttAuthority(AttAuthorityServiceBase, WSResource):
25     def __init__(self):
26         WSResource.__init__(self)
27
28     def soap_getAttCert(self, ps, **kw):
29         #import pdb;pdb.set_trace()
30         request, response = AttAuthorityService.soap_getAttCert(self, ps)
31         response._attCert = 'ATTRIBUTE CERT'
32         return request, response
33
34     def soap_getHostInfo(self, ps, **kw):
35         #import pdb;pdb.set_trace()
36         request, response = AttAuthorityService.soap_getHostInfo(self, ps)
37         response._hostInfo = 'HOST INFO'
38         return request, response
39
40     def soap_getTrustedHostInfo(self, ps, **kw):
41         #import pdb;pdb.set_trace()
42         request, response = \
43                AttAuthorityService.soap_getTrustedHostInfo(self, ps)
44         response._trustedHostInfo = 'TRUSTED HOST INFO'
45         return request, response
46
47     def soap_getPubKey(self, ps, **kw):
48         #import pdb;pdb.set_trace()
49         request, response = AttAuthorityService.soap_getPubKey(self, ps)
50         response._pubKey = 'PUB KEY'
51         return request, response
52
53portNum = 5700
54hostname = socket.gethostname()
55
56root = Resource()
57root.putChild('AttributeAuthority', AttAuthority())
58siteFactory = Site(root)
59application = service.Application("WSRF-Container")
60port = internet.TCPServer(portNum, siteFactory)#, interface=hostname)
61port.setServiceParent(application)
Note: See TracBrowser for help on using the repository browser.