Changeset 6284 for TI12-security/trunk/NDGSecurity
- Timestamp:
- 11/01/10 15:37:50 (11 years ago)
- Location:
- TI12-security/trunk/NDGSecurity/python
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/NDGSecurity/python/ndg_security/setup.py
r6134 r6284 42 42 setup( 43 43 name = 'ndg_security', 44 version = '1. 3.4',44 version = '1.4', 45 45 description = 'NERC DataGrid Security Utilities', 46 46 long_description = _longDescription, -
TI12-security/trunk/NDGSecurity/python/ndg_security_client/setup.py
r6134 r6284 44 44 setup( 45 45 name = 'ndg_security_client', 46 version = '1. 3.4',46 version = '1.4', 47 47 description = 'NERC DataGrid Security Client side interface', 48 48 long_description = _longDescription, -
TI12-security/trunk/NDGSecurity/python/ndg_security_common/setup.py
r6134 r6284 69 69 setup( 70 70 name = 'ndg_security_common', 71 version = '1. 3.4',71 version = '1.4', 72 72 description = 'NERC DataGrid Security package containing common ' 73 73 'utilities used by both server and client ' -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/authz/__init__.py
r6271 r6284 755 755 """ 756 756 PIP_MIDDLEWARE_CLASS = SamlPIPMiddleware 757 -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/authz/result_handler/__init__.py
r6271 r6284 12 12 __revision__ = "$Id: $" 13 13 __license__ = "BSD - see LICENSE file in top-level directory" 14 from ndg.security.server.wsgi.session import SessionMiddlewareBase 14 from ndg.security.server.wsgi.session import (SessionMiddlewareBase, 15 SessionHandlerMiddlewareError, SessionHandlerMiddlewareConfigError) 15 16 16 17 class PEPResultHandlerMiddlewareError(SessionHandlerMiddlewareError): 18 """Base exception for PEP Result Handler Middleware implementations""" 19 20 21 class PEPResultHandlerMiddlewareConfigError(SessionHandlerMiddlewareConfigError): 22 """Configuration errors from PEP Result Handler Middleware implementations 23 """ 24 25 17 26 class PEPResultHandlerMiddlewareBase(SessionMiddlewareBase): 18 27 """Abstract Base class for Policy Enforcement Point result handler 19 specialisations""" 28 specialisations 29 30 This class can be overridden to define custom behaviour for the access 31 denied response e.g. include an interface to enable users to register for 32 the dataset from which they have been denied access. See 33 AuthorizationMiddlewareBase pepResultHandler keyword. 34 35 Implementations of this class will be invoked if access is denied to a given 36 resource. An instance is incorporated into the call stack by passing it in 37 to a MultiHandler instance. 38 39 The MultiHandler is configured in the AuthorizationMiddlewareBase 40 class - see ndg.security.server.wsgi.authz. The MultiHandler is passed a 41 checker method which determines whether to allow access, or call this 42 interface. The checker is implemented in the PEPFilter. See 43 ndg.security.server.wsgi.authz 44 45 This class includes user session key and isAuthenticated property inherited 46 from SessionMiddlewareBase 47 """ 20 48 21 49 @SessionMiddlewareBase.initCall -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/authz/result_handler/basic.py
r6271 r6284 26 26 is incorporated into the call stack by passing it in to a MultiHandler 27 27 instance. The MultiHandler is configured in the AuthorizationMiddlewareBase 28 class below. The MultiHandler is passed a checker method which determines 29 whether to allow access, or call this interface. The checker is 30 implemented in the AuthorizationHandler. See below ... 31 32 This class can be overridden to define custom behaviour for the access 33 denied response e.g. include an interface to enable users to register for 34 the dataset from which they have been denied access. See 35 AuthorizationMiddlewareBase pepResultHandler keyword. 28 class - see ndg.security.server.wsgi.authz. The MultiHandler is passed a 29 checker method which determines whether to allow access, or call this 30 interface. The checker is implemented in the PEPFilter. See 31 ndg.security.server.wsgi.authz 36 32 37 33 PEPResultHandlerMiddlewareBase (SessionMiddlewareBase) base class defines -
TI12-security/trunk/NDGSecurity/python/ndg_security_server/setup.py
r6202 r6284 64 64 setup( 65 65 name = 'ndg_security_server', 66 version = '1. 3.4',66 version = '1.4', 67 67 description = 'Server side components for running NERC DataGrid ' 68 68 'Security Services', -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/config/attributeauthority/sitea/attributeCertificateLog
-
Property
svn:ignore
set to
ac.xml.*
-
Property
svn:ignore
set to
-
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/config/attributeauthority/sitea/attributeCertificateLog/ac.xml
r6107 r6284 1 <?xml version="1.0" encoding="utf-8"?> 2 <attributeCertificate xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" targetNamespace="urn:ndg:security:attributeCertificate"> 3 <acInfo> 4 <version>1.0</version> 5 <holder>/CN=server/O=NDG Security Test/OU=WS-Security Unittest</holder> 6 <issuer>/CN=AttributeAuthority/O=NDG Security Test/OU=Site A</issuer> 7 <issuerName>Site A</issuerName> 8 <issuerSerialNumber>253</issuerSerialNumber> 9 <userId>testuser</userId> 10 <validity> 11 <notBefore>2010 01 11 14 22 41</notBefore> 12 <notAfter>2010 01 11 22 22 41</notAfter> 13 </validity> 14 <attributes> 15 <roleSet> 16 <role> 17 <name>urn:siteA:security:authz:1.0:attr:postdoc</name> 18 </role> 19 <role> 20 <name>urn:siteA:security:authz:1.0:attr:staff</name> 21 </role> 22 <role> 23 <name>urn:siteA:security:authz:1.0:attr:undergrad</name> 24 </role> 25 <role> 26 <name>urn:siteA:security:authz:1.0:attr:coapec</name> 27 </role> 28 <role> 29 <name>urn:siteA:security:authz:1.0:attr:rapid</name> 30 </role> 31 </roleSet> 32 </attributes> 33 <provenance>original</provenance> 34 </acInfo> 35 <ds:Signature><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="ds"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></ds:SignatureMethod><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></ds:Transform><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="xmlns"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod><ds:DigestValue>ncqStnMQekAQXXUITV4pPmzQMjA=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>CQhhukNd+aiVMWnr7EvnU9pPmVSF0n8M4+giwwfOxZhyox/G4ZL/4iwQocRJPblkBMCvgoEcEgDm 36 Qq2RXzmQsqO3Q5LZFdtBUNJBJTRnxbPgpIP2z6YzK617e5qkXftdDvWZrrzkWBen1jBN8DhuOlcQ 37 rFt0JKBEGTO1ELjLzDY=</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIICBTCCAW6gAwIBAgICAP0wDQYJKoZIhvcNAQEEBQAwLzEMMAoGA1UEChMDTkRH 38 MQ0wCwYDVQQLEwRCQURDMRAwDgYDVQQDEwdUZXN0IENBMB4XDTA4MTIxNTE2MzUy 39 NFoXDTEzMTIxNDE2MzUyNFowSjEaMBgGA1UEChMRTkRHIFNlY3VyaXR5IFRlc3Qx 40 DzANBgNVBAsTBlNpdGUgQTEbMBkGA1UEAxMSQXR0cmlidXRlQXV0aG9yaXR5MIGf 41 MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCntf+hUxFKXx/KY3LXy/RYc/yqhfIL 42 M8h95c14n/WdSqh8rK3VxkUu5gujlEgCHafI2AjNZJZqJfKG7ZucYmRcnXbCX1qP 43 IGKa+TllbIWdsa5y/IF/Do2AoPMJnTNJ2U1IBfPQXbO5Sd49OvfTi4Cldk89872R 44 IuzPmLIDcFydgQIDAQABoxUwEzARBglghkgBhvhCAQEEBAMCBPAwDQYJKoZIhvcN 45 AQEEBQADgYEAWD04scBB91kWT8qXKZyN2EZ5nBFqs6REXtI+ddOaZt7VtiaHYMXA 46 mcRW/kCw8YgS+Ull+mZpAwpWUU9kR/A5dbiIDDRbxlz4BJCeMgkO/OxU31zmvqqa 47 23UyGXPhtaTuo8DG2uSr5XDk6GnJ5sb0WB3UgsRh7V4ryWkStImCSGY=</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature></attributeCertificate> -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/config/attributeauthority/siteb/attributeCertificateLog
-
Property
svn:ignore
set to
ac.xml
ac.xml.1
-
Property
svn:ignore
set to
-
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/credentialwallet
-
Property
svn:ignore
set to
NDGCredentialWalletPickle.dat
SAMLCredentialWalletPickle.dat
-
Property
svn:ignore
set to
-
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/wsgi/authz/test_authz.py
r6264 r6284 21 21 mkPath = lambda file: jnPath(os.environ['NDGSEC_COMBINED_SRVS_UNITTEST_DIR'], 22 22 file) 23 from ConfigParser import SafeConfigParser 23 24 24 25 import paste.fixture … … 27 28 from ndg.security.test.unit import BaseTestCase 28 29 from ndg.security.server.wsgi import NDGSecurityMiddlewareBase 30 from ndg.security.server.wsgi.authz.result_handler.basic import \ 31 PEPResultHandlerMiddleware 32 from ndg.security.server.wsgi.authz.result_handler.redirect import \ 33 HTTPRedirectPEPResultHandlerMiddleware 29 34 from ndg.security.server.wsgi.authz import (NdgPIPMiddlewareConfigError, 30 SamlPIPMiddlewareConfigError, 31 PEPResultHandlerMiddleware) 35 SamlPIPMiddlewareConfigError) 32 36 from ndg.security.common.authz.msi import Response 33 37 … … 97 101 98 102 class NdgWSGIAuthZTestCase(BaseTestCase): 99 103 INI_FILE = 'ndg-test.ini' 104 THIS_DIR = os.path.dirname(os.path.abspath(__file__)) 100 105 def __init__(self, *args, **kwargs): 101 106 BaseTestCase.__init__(self, *args, **kwargs) 102 107 103 here_dir = os.path.dirname(os.path.abspath(__file__)) 104 wsgiapp = loadapp('config:ndg-test.ini', relative_to=here_dir) 108 109 wsgiapp = loadapp('config:'+NdgWSGIAuthZTestCase.INI_FILE, 110 relative_to=NdgWSGIAuthZTestCase.THIS_DIR) 105 111 self.app = paste.fixture.TestApp(wsgiapp) 106 112 … … 257 263 258 264 class SamlWSGIAuthZTestCase(BaseTestCase): 259 265 INI_FILE = 'saml-test.ini' 266 THIS_DIR = os.path.dirname(os.path.abspath(__file__)) 260 267 def __init__(self, *args, **kwargs): 261 268 BaseTestCase.__init__(self, *args, **kwargs) 262 269 263 here_dir = os.path.dirname(os.path.abspath(__file__)) 264 wsgiapp = loadapp('config:saml-test.ini', relative_to=here_dir) 270 271 wsgiapp = loadapp('config:'+SamlWSGIAuthZTestCase.INI_FILE, 272 relative_to=SamlWSGIAuthZTestCase.THIS_DIR) 265 273 self.app = paste.fixture.TestApp(wsgiapp) 266 274 … … 386 394 387 395 396 class PEPResultHandlerTestCase(BaseTestCase): 397 INI_FILE = 'pep-result-handler-test.ini' 398 THIS_DIR = os.path.dirname(os.path.abspath(__file__)) 399 INI_FILEPATH = jnPath(THIS_DIR, INI_FILE) 400 401 def __init__(self, *arg, **kw): 402 BaseTestCase.__init__(self, *arg, **kw) 403 404 here_dir = os.path.dirname(os.path.abspath(__file__)) 405 wsgiapp = loadapp('config:'+PEPResultHandlerTestCase.INI_FILE, 406 relative_to=PEPResultHandlerTestCase.THIS_DIR) 407 self.app = paste.fixture.TestApp(wsgiapp) 408 409 cfg = SafeConfigParser(dict(here=PEPResultHandlerTestCase.THIS_DIR)) 410 cfg.read(jnPath(PEPResultHandlerTestCase.INI_FILEPATH)) 411 self.redirectURI = cfg.get('filter:AuthZFilter', 412 'authz.pepResultHandler.redirectURI') 413 414 self.startSiteAAttributeAuthority(withSSL=True, 415 port=SamlWSGIAuthZTestCase.SITEA_SSL_ATTRIBUTEAUTHORITY_PORTNUM) 416 417 418 def testRedirectPEPResultHandlerMiddleware(self): 419 # User is logged in but doesn't have the required credentials for 420 # access 421 extra_environ = { 422 'beaker.session.ndg.security': 423 BeakerSessionStub(username=PEPResultHandlerTestCase.OPENID_URI) 424 } 425 426 # Expecting redirect response to specified redirect URI 427 response = self.app.get('/test_accessDeniedToSecuredURI', 428 extra_environ=extra_environ, 429 status=302) 430 print(response) 431 self.assert_(response.header_dict.get('location') == self.redirectURI) 432 388 433 if __name__ == "__main__": 389 434 unittest.main() -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/setup.py
r6202 r6284 20 20 setup( 21 21 name = 'ndg_security_test', 22 version = '1. 3.4',22 version = '1.4', 23 23 description = 'NERC DataGrid Security Unit tests', 24 24 long_description = 'Unit tests client - server side',
Note: See TracChangeset
for help on using the changeset viewer.