Changeset 4381 for TI12-security/trunk
- Timestamp:
- 29/10/08 10:36:14 (12 years ago)
- Location:
- TI12-security/trunk/python
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/ndg.security.common/ndg/security/common/SQLObject.py
r4279 r4381 25 25 import cElementTree as ElementTree 26 26 27 from Cred Wallet import CredentialRepository as CredentialRepositoryBase28 from Cred Wallet import CredentialRepositoryError27 from CredentialWallet import CredentialRepository as CredentialRepositoryBase 28 from CredentialWallet import CredentialRepositoryError 29 29 30 30 … … 33 33 """Interface to Credential Repository Database 34 34 35 Nb. inherits from Cred Wallet.CredentialRepository to ensure correct interface35 Nb. inherits from CredentialWallet.CredentialRepository to ensure correct interface 36 36 to the wallet""" 37 37 -
TI12-security/trunk/python/ndg.security.common/ndg/security/common/__init__.py
r4331 r4381 21 21 'AttAuthority', 22 22 'AttCert', 23 'Cred Wallet',23 'CredentialWallet', 24 24 'm2CryptoSSLUtility', 25 25 'openssl', -
TI12-security/trunk/python/ndg.security.common/ndg/security/common/attributeauthority.py
r4377 r4381 4 4 unusual place of being required by both client and server 5 5 NDG security packages. For the server side they are required 6 as the Cred Wallet invoked by the Session Manager acts as a6 as the CredentialWallet invoked by the Session Manager acts as a 7 7 client to Attribute Authorities when negotiating the required 8 8 Attribute Certificate. -
TI12-security/trunk/python/ndg.security.server/ndg/security/server/sessionmanager.py
r4368 r4381 37 37 38 38 # Credential Wallet 39 from ndg.security.common. CredWallet import CredWallet, CredentialRepository, \40 Cred WalletError, CredWalletAttributeRequestDenied39 from ndg.security.common.credentialwallet import CredentialWallet, CredentialRepository, \ 40 CredentialWalletError, CredentialWalletAttributeRequestDenied 41 41 42 42 from ndg.security.common.wssecurity import WSSecurityConfig … … 84 84 85 85 def __init__(self, **credWalletKeys): 86 """Initialise UserSession with keywords to Cred Wallet"""86 """Initialise UserSession with keywords to CredentialWallet""" 87 87 88 88 log.debug("UserSession.__init__ ...") … … 92 92 self.__sessIdList = [] 93 93 self.addNewSessID() 94 self.__credWallet = Cred Wallet(**credWalletKeys)94 self.__credWallet = CredentialWallet(**credWalletKeys) 95 95 96 96 log.info("Created a session with ID = %s" % self.__sessIdList[-1]) 97 97 98 def __getCred Wallet(self):98 def __getCredentialWallet(self): 99 99 """Get Credential Wallet instance""" 100 100 return self.__credWallet 101 101 102 credWallet = property(fget=__getCred Wallet,103 doc="Read-only access to Cred Wallet instance")102 credWallet = property(fget=__getCredentialWallet, 103 doc="Read-only access to CredentialWallet instance") 104 104 105 105 def __getSessIdList(self): … … 259 259 'sslCACertDir': None, 260 260 AUTHN_KEYNAME: authNServicePropertyDefaults, 261 CREDWALLET_KEYNAME: Cred Wallet.propertyDefaults,261 CREDWALLET_KEYNAME: CredentialWallet.propertyDefaults, 262 262 CREDREPOS_KEYNAME: credentialRepositoryPropertyDefaults 263 263 } … … 556 556 sections=(section,)) 557 557 558 # Keep a copy of the config file for the Cred Wallet to reference so558 # Keep a copy of the config file for the CredentialWallet to reference so 559 559 # that it can retrieve WS-Security settings 560 560 self._cfg = readPropertiesFile.cfg … … 1014 1014 1015 1015 @type credWalletKw: dict 1016 @param **credWalletKw: keywords to Cred Wallet.getAttCert1016 @param **credWalletKw: keywords to CredentialWallet.getAttCert 1017 1017 """ 1018 1018 … … 1030 1030 return attCert, None, [] 1031 1031 1032 except Cred WalletAttributeRequestDenied, e:1032 except CredentialWalletAttributeRequestDenied, e: 1033 1033 # Exception object contains a list of attribute certificates 1034 1034 # which could be used to re-try to get authorisation via a mapped -
TI12-security/trunk/python/ndg.security.test/ndg/security/test/credentialwallet/test_credentialwallet.py
r4380 r4381 20 20 CaseSensitiveConfigParser 21 21 from ndg.security.common.X509 import X509CertParse 22 from ndg.security.common. CredWallet import CredWallet, \23 Cred WalletAttributeRequestDenied22 from ndg.security.common.credentialwallet import CredentialWallet, \ 23 CredentialWalletAttributeRequestDenied 24 24 25 25 from os.path import expandvars as xpdVars … … 31 31 32 32 33 class Cred WalletTestCase(unittest.TestCase):34 """Unit test case for ndg.security.common. CredWallet.CredWallet class.33 class CredentialWalletTestCase(unittest.TestCase): 34 """Unit test case for ndg.security.common.credentialwallet.CredentialWallet class. 35 35 36 36 """ … … 55 55 56 56 try: 57 Cred Wallet.accessDenied = 'yes'57 CredentialWallet.accessDenied = 'yes' 58 58 self.fail("accessDenied class variable should be read-only") 59 59 except Exception, e: … … 61 61 62 62 try: 63 Cred Wallet.accessGranted = False63 CredentialWallet.accessGranted = False 64 64 self.fail("accessGranted class variable should be read-only") 65 65 except Exception, e: 66 66 print("PASS - accessGranted class variable is read-only") 67 67 68 assert(not Cred Wallet.accessDenied)69 assert(Cred Wallet.accessGranted)68 assert(not CredentialWallet.accessDenied) 69 assert(CredentialWallet.accessGranted) 70 70 71 71 72 72 def test2SetAttributes(self): 73 73 74 credWallet = Cred Wallet()74 credWallet = CredentialWallet() 75 75 credWallet.userX509Cert = \ 76 76 '''-----BEGIN CERTIFICATE----- … … 113 113 def test3GetAttCertWithUserId(self): 114 114 115 credWallet = Cred Wallet(cfg=self.cfg.get('setUp', 'cfgFilePath'))115 credWallet = CredentialWallet(cfg=self.cfg.get('setUp', 'cfgFilePath')) 116 116 attCert = credWallet.getAttCert() 117 117 … … 123 123 def test4GetAttCertWithUserX509Cert(self): 124 124 125 credWallet = Cred Wallet(cfg=self.cfg.get('setUp', 'cfgFilePath'))125 credWallet = CredentialWallet(cfg=self.cfg.get('setUp', 'cfgFilePath')) 126 126 127 127 # Set a test individual user certificate to override the client … … 185 185 def test5GetAttCertRefusedWithUserCert(self): 186 186 187 credWallet = Cred Wallet(cfg=self.cfg.get('setUp', 'cfgFilePath'))187 credWallet = CredentialWallet(cfg=self.cfg.get('setUp', 'cfgFilePath')) 188 188 credWallet.userX509CertFilePath = self.cfg.get('setUp', 189 189 'userX509CertFilePath') … … 197 197 try: 198 198 attCert = credWallet.getAttCert() 199 except Cred WalletAttributeRequestDenied, e:199 except CredentialWalletAttributeRequestDenied, e: 200 200 print "SUCCESS - obtained expected result: %s" % e 201 201 return … … 207 207 208 208 # Call Site A Attribute Authority where user is registered 209 credWallet = Cred Wallet(cfg=self.cfg.get('setUp', 'cfgFilePath'))209 credWallet = CredentialWallet(cfg=self.cfg.get('setUp', 'cfgFilePath')) 210 210 attCert = credWallet.getAttCert() 211 211
Note: See TracChangeset
for help on using the changeset viewer.