- Timestamp:
- 24/02/10 09:40:47 (11 years ago)
- Location:
- TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/wsgi
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/wsgi/__init__.py
r6069 r6617 40 40 ssl_context=ssl_context) 41 41 42 def _getPasteServer(self): 42 @property 43 def pasteServer(self): 43 44 return self.__pasteServer 44 45 45 pasteServer = property(fget=_getPasteServer) 46 47 def _getThread(self): 46 @property 47 def thread(self): 48 48 return self.__thread 49 50 thread = property(fget=_getThread)51 49 52 50 def start(self): -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/wsgi/saml/authz-service.ini
r6615 r6617 47 47 # Attribute Authorities 48 48 authz.pip.attributeQuery.subjectIdFormat = urn:esg:openid 49 authz.pip.attributeQuery.verifyTimeConditions = True 49 authz.pip.attributeQuery.queryAttributes.0 = urn:siteA:security:authz:1.0:attr, , http://www.w3.org/2001/XMLSchema#string 50 authz.pip.attributeQuery.sslCACertDir=%(testConfigDir)s/ca 51 authz.pip.attributeQuery.sslCertFilePath=%(testConfigDir)s/pki/test.crt 52 authz.pip.attributeQuery.sslPriKeyFilePath=%(testConfigDir)s/pki/test.key -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/wsgi/saml/policy-1.1.xml
r6615 r6617 4 4 5 5 <Target> 6 <URIPattern> http://localhost/dap/data/.*</URIPattern>6 <URIPattern>^http://localhost/dap/data/.*</URIPattern> 7 7 <Attributes> 8 8 <Attribute> 9 9 <Name>urn:siteA:security:authz:1.0:attr:staff</Name> 10 <AttributeAuthorityURI>https://localhost:5443/AttributeAuthority </AttributeAuthorityURI>10 <AttributeAuthorityURI>https://localhost:5443/AttributeAuthority/saml</AttributeAuthorityURI> 11 11 </Attribute> 12 12 </Attributes> 13 13 </Target> 14 14 <Target> 15 <URIPattern>^ /test_accessDeniedToSecuredURI$</URIPattern>15 <URIPattern>^http://localhost/dap/data/test_accessDeniedToSecuredURI$</URIPattern> 16 16 <Attributes> 17 17 <Attribute> 18 18 <Name>urn:siteA:security:authz:1.0:attr:forbidden</Name> 19 <AttributeAuthorityURI>https://localhost:5443/AttributeAuthority </AttributeAuthorityURI>19 <AttributeAuthorityURI>https://localhost:5443/AttributeAuthority/saml</AttributeAuthorityURI> 20 20 </Attribute> 21 21 <Attribute> 22 22 <Name>urn:siteA:security:authz:1.0:attr:keepout</Name> 23 <AttributeAuthorityURI>https://localhost:5443/AttributeAuthority </AttributeAuthorityURI>23 <AttributeAuthorityURI>https://localhost:5443/AttributeAuthority/saml</AttributeAuthorityURI> 24 24 </Attribute> 25 25 </Attributes> … … 31 31 <Attribute> 32 32 <Name>urn:siteA:security:authz:1.0:attr:staff</Name> 33 <AttributeAuthorityURI>https://localhost:5443/AttributeAuthority </AttributeAuthorityURI>33 <AttributeAuthorityURI>https://localhost:5443/AttributeAuthority/saml</AttributeAuthorityURI> 34 34 </Attribute> 35 35 </Attributes> -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/wsgi/saml/test_soapauthzdecisioninterface.py
r6615 r6617 198 198 CONFIG_FILENAME = 'authz-service.ini' 199 199 RESOURCE_URI = 'http://localhost/dap/data/my.nc.dods?time[0:1:0]' 200 ACCESS_DENIED_RESOURCE_URI = 'http://localhost/dap/data/test_accessDeniedToSecuredURI' 200 201 201 202 def __init__(self, *arg, **kw): … … 205 206 *arg, **kw) 206 207 self.startSiteAAttributeAuthority(withSSL=True, port=5443) 208 209 def test02AccessDenied(self): 210 cls = SOAPAuthzServiceMiddlewareTestCase 211 query = self._createAuthzDecisionQuery( 212 resource=cls.ACCESS_DENIED_RESOURCE_URI) 213 request = self._makeRequest(query=query) 214 215 header = { 216 'soapAction': "http://www.oasis-open.org/committees/security", 217 'Content-length': str(len(request)), 218 'Content-type': 'text/xml' 219 } 220 response = self.app.post('/authorisationservice/', 221 params=request, 222 headers=header, 223 status=200) 224 print("Response status=%d" % response.status) 225 samlResponse = self._getSAMLResponse(response.body) 226 227 self.assert_(samlResponse.status.statusCode.value == \ 228 StatusCode.SUCCESS_URI) 229 self.assert_(samlResponse.inResponseTo == query.id) 230 self.assert_(samlResponse.assertions[0].subject.nameID.value == \ 231 query.subject.nameID.value) 232 self.assert_(samlResponse.assertions[0]) 233 self.assert_(samlResponse.assertions[0].authzDecisionStatements[0]) 234 self.assert_(samlResponse.assertions[0].authzDecisionStatements[0 235 ].decision == DecisionType.DENY) 207 236 208 237
Note: See TracChangeset
for help on using the changeset viewer.