- Timestamp:
- 15/02/10 11:33:01 (11 years ago)
- Location:
- TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/attributeauthorityclient
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/attributeauthorityclient/__init__.py
r6571 r6572 43 43 except KeyError: 44 44 self.sslCACertList = [] 45 46 self.startAttributeAuthorities() 45 -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/attributeauthorityclient/test_attributeauthorityclient.py
r6571 r6572 32 32 pemPat = "-----BEGIN CERTIFICATE-----[^\-]*-----END CERTIFICATE-----" 33 33 34 def __init__(self, *arg, **kw): 35 super(AttributeAuthorityClientTestCase, self).__init__(*arg, **kw) 36 self.startAttributeAuthorities() 37 34 38 def _getCertChainFromProxyCertFile(self, proxyCertFilePath): 35 39 '''Read proxy cert and user cert from a single PEM file and put in -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/attributeauthorityclient/test_samlattributeauthorityclient.cfg
r6571 r6572 30 30 subject = https://openid.localhost/philip.kershaw 31 31 siteAttributeName = invalid-attr 32 prefix = saml. 33 saml.serialise = saml.xml.etree:AttributeQueryElementTree.toXML 34 saml.deserialise = saml.xml.etree:ResponseElementTree.fromXML 32 35 33 36 [test05AttributeQuerySOAPBindingInterface] -
TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/unit/attributeauthorityclient/test_samlattributeauthorityclient.py
r6571 r6572 26 26 AttributeQuerySOAPBinding, 27 27 AttributeQuerySslSOAPBinding) 28 from ndg.security.common.saml_utils.esg import EsgSamlNamespaces 28 from ndg.security.common.saml_utils.esg import (EsgSamlNamespaces, 29 EsgDefaultQueryAttributes) 29 30 from ndg.security.test.unit.attributeauthorityclient import \ 30 31 AttributeAuthorityClientBaseTestCase … … 40 41 super(AttributeAuthoritySAMLInterfaceTestCase, self).__init__(*arg, 41 42 **kw) 43 44 # Run same config but on two different ports - one HTTP and one HTTPS 45 self.startSiteAAttributeAuthority() 42 46 self.startSiteAAttributeAuthority(withSSL=True, port=5443) 43 47 … … 54 58 attributeQuery.issuer.value = "/CN=Authorisation Service/O=Site A" 55 59 56 attributeQuery.subject = Subject() 60 attributeQuery.subject = Subject() 57 61 attributeQuery.subject.nameID = NameID() 58 62 attributeQuery.subject.nameID.format = EsgSamlNamespaces.NAMEID_FORMAT … … 120 124 attributeQuery.issuer = Issuer() 121 125 attributeQuery.issuer.format = Issuer.X509_SUBJECT 122 attributeQuery.issuer.value = " Invalid Site"126 attributeQuery.issuer.value = "/O=Invalid Site/CN=PDP" 123 127 124 128 attributeQuery.subject = Subject() … … 136 140 137 141 binding = SOAPBinding() 142 binding.serialise = AttributeQueryElementTree.toXML 143 binding.deserialise = ResponseElementTree.fromXML 138 144 response = binding.send(attributeQuery, _cfg['uri']) 139 145 … … 174 180 175 181 binding = SOAPBinding() 182 binding.serialise = AttributeQueryElementTree.toXML 183 binding.deserialise = ResponseElementTree.fromXML 176 184 response = binding.send(attributeQuery, _cfg['uri']) 177 185 … … 186 194 187 195 def test04SAMLAttributeQueryInvalidAttrName(self): 188 _cfg = self.cfg['test04SAMLAttributeQueryInvalidAttrName'] 196 thisSection = 'test04SAMLAttributeQueryInvalidAttrName' 197 _cfg = self.cfg[thisSection] 189 198 190 199 attributeQuery = AttributeQuery() … … 210 219 attributeQuery.attributes.append(invalidAttribute) 211 220 212 binding = SOAPBinding() 221 binding = SOAPBinding.fromConfig( 222 AttributeAuthoritySAMLInterfaceTestCase.CONFIG_FILENAME, 223 prefix='saml.', 224 section=thisSection) 213 225 response = binding.send(attributeQuery, _cfg['uri']) 214 226 … … 229 241 230 242 binding.subjectID = AttributeAuthoritySAMLInterfaceTestCase.OPENID_URI 231 binding.issuerDN = \ 232 AttributeAuthoritySAMLInterfaceTestCase.VALID_REQUESTOR_IDS[0] 243 binding.subjectIdFormat = EsgSamlNamespaces.NAMEID_FORMAT 244 binding.issuerName = \ 245 str(AttributeAuthoritySAMLInterfaceTestCase.VALID_REQUESTOR_IDS[0]) 246 binding.issuerFormat = Issuer.X509_SUBJECT 233 247 234 248 binding.queryAttributes = EsgDefaultQueryAttributes.ATTRIBUTES
Note: See TracChangeset
for help on using the changeset viewer.