Changeset 4392
- Timestamp:
- 29/10/08 11:49:44 (11 years ago)
- Location:
- TI12-security/trunk/python
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/Tests/AttAuthority/AttAuthorityClient.py
r4377 r4392 3 3 #from twisted.internet import reactor 4 4 5 from ndg.security.common.zsi.attributeauthority.Att Authority_services import AttAuthorityServiceLocator5 from ndg.security.common.zsi.attributeauthority.AttributeAuthority_services import AttributeAuthorityServiceLocator 6 6 7 7 def main(**kw): 8 locator = Att AuthorityServiceLocator()9 port = locator.getAtt Authority(**kw)8 locator = AttributeAuthorityServiceLocator() 9 port = locator.getAttributeAuthority(**kw) 10 10 import pdb;pdb.set_trace() 11 11 attCert = port.getAttCert("USER CERT") … … 15 15 #response = port.create(CLIENT.CreateRequest()) 16 16 #kw['endPointReference'] = response._EndpointReference 17 #iport = locator.getAtt Authority(**kw)17 #iport = locator.getAttributeAuthority(**kw) 18 18 # reactor.stop() 19 19 -
TI12-security/trunk/python/Tests/AttAuthority/AttAuthorityServer.py
r4377 r4392 12 12 13 13 # Import the generated Server Object 14 from ndg.security.common.zsi.attributeauthority.Att Authority_services_server import AttAuthorityService14 from ndg.security.common.zsi.attributeauthority.AttributeAuthority_services_server import AttributeAuthorityService 15 15 16 16 … … 26 26 def do_GET(self): 27 27 """Return the WSDL file.""" 28 self.send_xml(Att AuthorityService._wsdl)28 self.send_xml(AttributeAuthorityService._wsdl) 29 29 30 30 def do_POST(self): … … 33 33 the wsdl e.g. http://glue.badc.rl.ac.uk/sessionMgr points to the 34 34 default port for the Session Manager.""" 35 self.path = "/Att AuthorityServIn"35 self.path = "/AttributeAuthorityServIn" 36 36 SOAPRequestHandler.do_POST(self) 37 37 38 class AttributeAuthorityImpl(Att AuthorityService):38 class AttributeAuthorityImpl(AttributeAuthorityService): 39 39 40 40 def soap_getAttCert(self, ps, **kw): 41 41 #import pdb;pdb.set_trace() 42 response = Att AuthorityService.soap_getAttCert(self, ps)42 response = AttributeAuthorityService.soap_getAttCert(self, ps) 43 43 response.set_element_attCert('ATTRIBUTE CERT') 44 44 return response … … 52 52 import sys 53 53 service = AttributeAuthorityImpl() 54 serviceContainer.setNode(service, url="/Att AuthorityServIn")54 serviceContainer.setNode(service, url="/AttributeAuthorityServIn") 55 55 56 56 try: -
TI12-security/trunk/python/Tests/AttAuthority/twistedClnt/AttAuthorityClient.py
r4377 r4392 5 5 import sys 6 6 7 from ndg.security.common.zsi.attributeauthority.Att Authority_services import AttAuthorityServiceLocator7 from ndg.security.common.zsi.attributeauthority.AttributeAuthority_services import AttributeAuthorityServiceLocator 8 8 9 9 def main(**kw): 10 locator = Att AuthorityServiceLocator()11 port = locator.getAtt Authority(**kw)10 locator = AttributeAuthorityServiceLocator() 11 port = locator.getAttributeAuthority(**kw) 12 12 import pdb;pdb.set_trace() 13 13 attCert = port.getAttCert("USER CERT") … … 17 17 #response = port.create(CLIENT.CreateRequest()) 18 18 #kw['endPointReference'] = response._EndpointReference 19 #iport = locator.getAtt Authority(**kw)19 #iport = locator.getAttributeAuthority(**kw) 20 20 reactor.stop() 21 21 -
TI12-security/trunk/python/Tests/pylonsAttributeAuthority/ndgsecurity/ndgsecurity/config/attributeauthority.py
r4377 r4392 5 5 6 6 7 from ndg.security.server.attributeauthority.Att Authority_services_server import \8 Att AuthorityService as _AttAuthorityService7 from ndg.security.server.attributeauthority.AttributeAuthority_services_server import \ 8 AttributeAuthorityService as _AttributeAuthorityService 9 9 10 10 from ndg.security.server.attributeauthority import AttributeAuthority, \ … … 16 16 17 17 18 class AttributeAuthorityWS(_Att AuthorityService):18 class AttributeAuthorityWS(_AttributeAuthorityService): 19 19 20 20 def __init__(self): … … 43 43 pdb.set_trace() 44 44 45 request, response = _Att AuthorityService.soap_getAttCert(self, ps)45 request, response = _AttributeAuthorityService.soap_getAttCert(self, ps) 46 46 47 47 # Derive designated holder cert differently according to whether … … 79 79 pdb.set_trace() 80 80 81 request, response = _Att AuthorityService.soap_getHostInfo(self, ps)81 request, response = _AttributeAuthorityService.soap_getHostInfo(self, ps) 82 82 83 83 response.Hostname = self.aa.hostInfo.keys()[0] … … 104 104 pdb.set_trace() 105 105 106 request, response = _Att AuthorityService.soap_getAllHostsInfo(self, ps)106 request, response = _AttributeAuthorityService.soap_getAllHostsInfo(self, ps) 107 107 108 108 … … 159 159 160 160 request, response = \ 161 _Att AuthorityService.soap_getTrustedHostInfo(self, ps)161 _AttributeAuthorityService.soap_getTrustedHostInfo(self, ps) 162 162 163 163 trustedHostInfo = self.aa.getTrustedHostInfo(role=request.Role) … … 194 194 pdb.set_trace() 195 195 196 request, response = _Att AuthorityService.soap_getX509Cert(self, ps)196 request, response = _AttributeAuthorityService.soap_getX509Cert(self, ps) 197 197 198 198 x509Cert = X509CertRead(self.aa['signingCertFilePath']) -
TI12-security/trunk/python/ndg.security.common/ndg/security/common/attributeauthority.py
r4384 r4392 32 32 from ZSI.wstools.Utility import HTTPResponse 33 33 34 from ndg.security.common.zsi.attributeauthority.Att Authority_services import \35 Att AuthorityServiceLocator34 from ndg.security.common.zsi.attributeauthority.AttributeAuthority_services import \ 35 AttributeAuthorityServiceLocator 36 36 from ndg.security.common.wssecurity.dom import SignatureHandler 37 37 from ndg.security.common.AttCert import AttCert, AttCertParse … … 271 271 # WS-Security Signature handler object is passed to binding 272 272 try: 273 locator = Att AuthorityServiceLocator()274 self.__srv = locator.getAtt Authority(self.__uri,273 locator = AttributeAuthorityServiceLocator() 274 self.__srv = locator.getAttributeAuthority(self.__uri, 275 275 sig_handler=self.__signatureHandler, 276 276 tracefile=self.__tracefile, -
TI12-security/trunk/python/ndg.security.common/ndg/security/common/credentialwallet.py
r4379 r4392 24 24 25 25 # Access Attribute Authority's web service using ZSI - allow pass if not 26 # loaded since it's possible to make Att Authority instance locally without26 # loaded since it's possible to make AttributeAuthority instance locally without 27 27 # using the WS 28 28 aaImportError = True 29 29 try: 30 # Att Authority client package resides with CredentialWallet module in30 # AttributeAuthority client package resides with CredentialWallet module in 31 31 # ndg.security.common 32 from ndg.security.common.attributeauthority import AttributeAuthorityClient,\33 AttributeAuthorityClient Error, AttributeRequestDenied, \34 NoMatchingRoleInTrustedHosts32 from ndg.security.common.attributeauthority import \ 33 AttributeAuthorityClient, AttributeAuthorityClientError, \ 34 AttributeRequestDenied, NoMatchingRoleInTrustedHosts 35 35 aaImportError = False 36 36 except ImportError: … … 38 38 pass 39 39 40 # Likewise - may not want to use WS and use AttributeAuthority locally in which case41 # no need to import it40 # Likewise - may not want to use WS and use AttributeAuthority locally in which 41 # case no need to import it 42 42 try: 43 43 from ndg.security.server.attributeauthority import AttributeAuthority, \ … … 45 45 aaImportError = False 46 46 except: 47 log.warning('Loading CredentialWallet without Attribute Authority interface'48 'i mports')47 log.warning('Loading CredentialWallet without Attribute Authority ' 48 'interface imports') 49 49 pass 50 50 51 51 if aaImportError: 52 raise ImportError("Either AttributeAuthority or AttributeAuthorityClient classes must"53 " be present to allow interoperation with Attribute"54 "A uthorities")52 raise ImportError("Either AttributeAuthority or AttributeAuthorityClient " 53 "classes must be present to allow interoperation with " 54 "Attribute Authorities") 55 55 56 56 # Authentication X.509 Certificate … … 68 68 69 69 class _CredentialWalletException(Exception): 70 """Generic Exception class for CredentialWallet module. Overrides Exception to71 enable writing to the log"""70 """Generic Exception class for CredentialWallet module. Overrides 71 Exception to enable writing to the log""" 72 72 def __init__(self, msg): 73 73 log.error(msg) … … 156 156 157 157 158 # CredentialWallet is a 'new-style' class inheriting from "object" and making use159 # of new Get/Set methods for hiding of attributes158 # CredentialWallet is a 'new-style' class inheriting from "object" and making 159 # use of new Get/Set methods for hiding of attributes 160 160 class CredentialWallet(object): 161 161 """Volatile store of user credentials associated with a user session … … 329 329 from 330 330 @type cfgPrefix: basestring 331 @param cfgPrefix: apply a prefix to all CredentialWallet config params so332 that if placed in a file with other parameters they can be331 @param cfgPrefix: apply a prefix to all CredentialWallet config params 332 so that if placed in a file with other parameters they can be 333 333 distinguished 334 334 @type cfgKw: dict -
TI12-security/trunk/python/ndg.security.server/ndg/security/server/zsi/attributeauthority/__init__.py
r4377 r4392 16 16 log = logging.getLogger(__name__) 17 17 18 from ndg.security.common.zsi.attributeauthority.Att Authority_services import \18 from ndg.security.common.zsi.attributeauthority.AttributeAuthority_services import \ 19 19 getAttCertInputMsg, getAttCertOutputMsg, \ 20 20 getHostInfoInputMsg, getHostInfoOutputMsg, \ … … 23 23 getX509CertInputMsg, getX509CertOutputMsg 24 24 25 from ndg.security.server.zsi.attributeauthority.Att Authority_services_server \26 import Att AuthorityService as _AttAuthorityService25 from ndg.security.server.zsi.attributeauthority.AttributeAuthority_services_server \ 26 import AttributeAuthorityService as _AttributeAuthorityService 27 27 28 28 from ndg.security.server.attributeauthority import AttributeAuthority, \ … … 33 33 34 34 35 class AttributeAuthorityWS(_Att AuthorityService):35 class AttributeAuthorityWS(_AttributeAuthorityService): 36 36 '''Attribute Authority ZSI SOAP Service Binding class''' 37 37 … … 55 55 @type ps: ZSI ParsedSoap 56 56 @param ps: client SOAP message 57 @rtype: ndg.security.common.zsi.attributeauthority.Att Authority_services_types.getAttCertResponse_Holder57 @rtype: ndg.security.common.zsi.attributeauthority.AttributeAuthority_services_types.getAttCertResponse_Holder 58 58 @return: response''' 59 59 if self.__debug: … … 62 62 63 63 request = ps.Parse(getAttCertInputMsg.typecode) 64 response = _Att AuthorityService.soap_getAttCert(self, ps)64 response = _AttributeAuthorityService.soap_getAttCert(self, ps) 65 65 66 66 # Derive designated holder cert differently according to whether … … 102 102 pdb.set_trace() 103 103 104 response = _Att AuthorityService.soap_getHostInfo(self, ps)104 response = _AttributeAuthorityService.soap_getHostInfo(self, ps) 105 105 106 106 response.Hostname = self.aa.hostInfo.keys()[0] … … 127 127 pdb.set_trace() 128 128 129 response = _Att AuthorityService.soap_getAllHostsInfo(self, ps)129 response = _AttributeAuthorityService.soap_getAllHostsInfo(self, ps) 130 130 131 131 … … 182 182 183 183 request = ps.Parse(getTrustedHostInfoInputMsg.typecode) 184 response = _Att AuthorityService.soap_getTrustedHostInfo(self, ps)184 response = _AttributeAuthorityService.soap_getTrustedHostInfo(self, ps) 185 185 186 186 trustedHostInfo = self.aa.getTrustedHostInfo(role=request.Role) … … 217 217 pdb.set_trace() 218 218 219 response = _Att AuthorityService.soap_getX509Cert(self, ps)219 response = _AttributeAuthorityService.soap_getX509Cert(self, ps) 220 220 221 221 x509Cert = X509CertRead(self.aa['signingCertFilePath']) -
TI12-security/trunk/python/ndg.security.server/ndg/security/server/zsi/twisted/attributeauthority/attAuthority.tac
r4377 r4392 37 37 38 38 from \ 39 ndg.security.server.zsi.twisted.attributeauthority. AttAuthority_services_server\40 import AttAuthorityService39 ndg.security.server.zsi.twisted.attributeauthority.SessionManager_services_server\ 40 import SessionManagerService 41 41 42 42 from ndg.security.server.attributeauthority import AttributeAuthority, \ … … 82 82 pdb.set_trace() 83 83 84 request, response = AttAuthorityService.soap_getAttCert(self, ps)84 request, response = SessionManagerService.soap_getAttCert(self, ps) 85 85 86 86 # Derive designated holder cert differently according to whether … … 119 119 pdb.set_trace() 120 120 121 request, response = AttAuthorityService.soap_getHostInfo(self, ps)121 request, response = SessionManagerService.soap_getHostInfo(self, ps) 122 122 123 123 response.Hostname = srv.aa.hostInfo.keys()[0] … … 144 144 pdb.set_trace() 145 145 146 request, response = AttAuthorityService.soap_getAllHostsInfo(self, ps)146 request, response = SessionManagerService.soap_getAllHostsInfo(self, ps) 147 147 148 148 … … 199 199 200 200 request, response = \ 201 AttAuthorityService.soap_getTrustedHostInfo(self, ps)201 SessionManagerService.soap_getTrustedHostInfo(self, ps) 202 202 203 203 trustedHostInfo = srv.aa.getTrustedHostInfo(role=request.Role) … … 234 234 pdb.set_trace() 235 235 236 request, response = Att AuthorityService.soap_getX509Cert(self, ps)236 request, response = AttributeAuthorityService.soap_getX509Cert(self, ps) 237 237 238 238 x509Cert = X509CertRead(srv.aa['signingCertFilePath'])
Note: See TracChangeset
for help on using the changeset viewer.