Changeset 7526 for TI12-security


Ignore:
Timestamp:
27/09/10 13:08:12 (9 years ago)
Author:
pjkersha
Message:

Preparing new release. All working tests pass:

  • fixed X.509 Subject name urn
  • added test for content length for query input to query interface
  • fixed test_queryresponse - removed ESG specific attribute references.
Location:
TI12-security/trunk/ndg_saml/ndg/saml
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/ndg_saml/ndg/saml/saml2/binding/soap/server/wsgi/queryinterface.py

    r7147 r7526  
    379379 
    380380        contentLength = int(contentLength) 
     381        if contentLength <= 0: 
     382            raise SOAPQueryInterfaceMiddlewareError('"CONTENT_LENGTH" in ' 
     383                                                    'environ is %d' % 
     384                                                    contentLength) 
     385             
    381386        soapRequestTxt = soapRequestStream.read(contentLength) 
    382387         
  • TI12-security/trunk/ndg_saml/ndg/saml/saml2/core.py

    r7130 r7526  
    12181218 
    12191219    # URI for X509 subject name format. 
    1220     X509_SUBJECT = "urn:oasis:names:tc:SAML:1.1:nameid-format:x509SubjectName" 
     1220    X509_SUBJECT = "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName" 
    12211221 
    12221222    # URI for windows domain qualified name name format. 
  • TI12-security/trunk/ndg_saml/ndg/saml/test/binding/soap/test_queryresponseinterface.py

    r7154 r7526  
    140140        # Convert to ElementTree representation to enable attachment to SOAP 
    141141        # response body 
    142         samlResponseElem = ResponseElementTree.toXML(samlResponse, 
    143                                             customToXMLTypeMap=toXMLTypeMap) 
     142        samlResponseElem = ResponseElementTree.toXML(samlResponse) 
    144143        xml = ElementTree.tostring(samlResponseElem) 
    145144        log.debug('Sending response to query:\n%s', xml) 
     
    162161    thisDir = os.path.dirname(os.path.abspath(__file__)) 
    163162    RESPONSE = '''\ 
    164 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> 
    165    <SOAP-ENV:Body> 
     163<soap11:Envelope xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"> 
     164   <soap11:Body> 
    166165      <samlp:Response ID="05680cb2-4973-443d-9d31-7bc99bea87c1" InResponseTo="e3183380-ae82-4285-8827-8c40613842de" IssueInstant="%(issueInstant)s" Version="2.0" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"> 
    167          <saml:Issuer Format="urn:esg:issuer" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">ESG-NCAR</saml:Issuer> 
     166         <saml:Issuer Format="urn:esg:issuer" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">Somewhere</saml:Issuer> 
    168167         <samlp:Status> 
    169168            <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" /> 
    170169         </samlp:Status> 
    171170         <saml:Assertion ID="192c67d9-f9cd-457a-9242-999e7b943166" IssueInstant="%(assertionIssueInstant)s" Version="2.0" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"> 
    172             <saml:Issuer Format="urn:esg:issuer">ESG-NCAR</saml:Issuer> 
     171            <saml:Issuer Format="urn:esg:issuer">Somewhere</saml:Issuer> 
    173172            <saml:Subject> 
    174                <saml:NameID Format="urn:esg:openid">https://esg.prototype.ucar.edu/myopenid/testUser</saml:NameID> 
     173               <saml:NameID Format="urn:esg:openid">https://somewhere.edu/myopenid/testUser</saml:NameID> 
    175174            </saml:Subject> 
    176175            <saml:Conditions NotBefore="%(notBefore)s" NotOnOrAfter="%(notOnOrAfter)s" /> 
     
    183182               </saml:Attribute> 
    184183               <saml:Attribute FriendlyName="EmailAddress" Name="urn:esg:first:email:address" NameFormat="http://www.w3.org/2001/XMLSchema#string"> 
    185                   <saml:AttributeValue xsi:type="xs:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">ejn@ucar.edu</saml:AttributeValue> 
    186                </saml:Attribute> 
    187                <saml:Attribute FriendlyName="GroupRole" Name="urn:esg:group:role" NameFormat="groupRole"> 
    188                   <saml:AttributeValue> 
    189                      <esg:groupRole group="CCSM" role="default" xmlns:esg="http://www.esg.org" /> 
    190                   </saml:AttributeValue> 
    191                   <saml:AttributeValue> 
    192                      <esg:groupRole group="Dynamical Core" role="default" xmlns:esg="http://www.esg.org" /> 
    193                   </saml:AttributeValue> 
    194                   <saml:AttributeValue> 
    195                      <esg:groupRole group="NARCCAP" role="default" xmlns:esg="http://www.esg.org" /> 
    196                   </saml:AttributeValue> 
     184                  <saml:AttributeValue xsi:type="xs:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">someone@somewhere.edu</saml:AttributeValue> 
    197185               </saml:Attribute> 
    198186            </saml:AttributeStatement> 
    199187         </saml:Assertion> 
    200188      </samlp:Response> 
    201    </SOAP-ENV:Body> 
    202 </SOAP-ENV:Envelope> 
     189   </soap11:Body> 
     190</soap11:Envelope> 
    203191''' 
    204192 
Note: See TracChangeset for help on using the changeset viewer.