/usr/lib/python2.6/site-packages/keystoneauth1/tests/unit/extras/saml2
NameSizeModeActions
examples/-0755rm
fixtures/-0755rm
test_auth_adfs.py101800644editdlrm
test_auth_adfs.pyc97260644editdlrm
test_auth_saml2.py107040644editdlrm
test_auth_saml2.pyc95770644editdlrm
utils.py11200644editdlrm
utils.pyc16530644editdlrm
__init__.py00644editdlrm
__init__.pyc1720644editdlrm
Edit: /usr/lib/python2.6/site-packages/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyc (9726B)
Ñò 7 Wc @s©ddkZddklZddklZddklZddklZ ddk l Z ddk l Zddk lZdd k lZd eifd „ƒYZdS( iÿÿÿÿN(tetree(turllib(t exceptions(t_saml2(tclient_fixtures(tfixtures(tutils(tmatcherstAuthenticateviaADFSTestscBsøeZdZhdd6dd6dd6dd6dd 6d d 6Zd Zd ZdZdZei ƒi Z dZ e d„ƒZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS( tauths'http://www.w3.org/2003/05/soap-envelopetss0http://docs.oasis-open.org/ws-sx/ws-trust/200512ttrusts$http://www.w3.org/2005/08/addressingtwsas,http://schemas.xmlsoap.org/ws/2004/09/policytwsptasQhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsdtos:/s:Envelope/s:Header/o:Security/o:UsernameToken/o:Usernames:/s:Envelope/s:Header/o:Security/o:UsernameToken/o:Passwords]/s:Envelope/s:Body/trust:RequestSecurityToken/wsp:AppliesTo/wsa:EndpointReference/wsa:Addresss/s:Envelope/s:Header/a:Totsaml2cCsdS(Ns$4b911420-4982-4009-8afc-5c596cd487f5((tself((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyt_uuid4;scCs¥tt|ƒiƒd|_d|_d|idf|_d|_ti |i|i|i|i|i |i |i ƒ|_ tidƒ|_tidƒ|_dS(Ntadfss5http://adfs.local/adfs/service/trust/13/usernamemixeds%s/%ss:OS-FEDERATION/identity_providers/adfs/protocols/saml2/auths,https://openstack4.local/Shibboleth.sso/ADFSs%ADFS_RequestSecurityTokenResponse.xmlsADFS_fault.xml(tsuperRtsetUptIDENTITY_PROVIDERtIDENTITY_PROVIDER_URLtTEST_URLtFEDERATION_AUTH_URLt SP_ENDPOINTRtV3ADFSPasswordt TEST_USERt TEST_TOKENtPROTOCOLt adfspluginRt _load_xmltADFS_SECURITY_TOKEN_RESPONSEt ADFS_FAULT(R((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyR?s       cCs†|ii|idti|iƒddƒ|iiƒ|ii|i ƒt i |ii ƒ}|i}|i |ti|ƒƒdS(s-Test ADFSPassword._get_adfs_security_token().tcontentt status_codeiÈN(t requests_mocktpostRRt make_onelineR!Rt_prepare_adfs_requestt_get_adfs_security_tokentsessionRttostringt adfs_tokent assertThatRt XMLEquals(Rt adfs_responsetfixture_response((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyttest_get_adfs_security_tokenSs     cCsL|iiƒ|iii|id|iƒd}|i|i|iƒdS(Nt namespacesi( RR(tprepared_requesttxpatht USER_XPATHt NAMESPACESt assertEqualRttext(Rtuser((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyttest_adfs_request_usercs  cCsL|iiƒ|iii|id|iƒd}|i|i|iƒdS(NR2i( RR(R3R4tPASSWORD_XPATHR6R7RR8(Rtpassword((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyttest_adfs_request_passwordis  cCsL|iiƒ|iii|id|iƒd}|i|i|iƒdS(NR2i( RR(R3R4tTO_XPATHR6R7RR8(Rtto((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyttest_adfs_request_toos  cCsL|iiƒ|iii|id|iƒd}|i|i|iƒdS(NR2i( RR(R3R4t ADDRESS_XPATHR6R7RR8(Rtaddress((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyt!test_prepare_adfs_request_addressus  cCs¹ti|iƒ}|itiidtiiƒ}|d}ti|ƒ}|i ddƒ}t i i |ƒ}d|}ti|iƒ|i _|i iƒ|i||i iƒdS(NR2is0http://docs.oasis-open.org/ws-sx/ws-trust/200512s+http://schemas.xmlsoap.org/ws/2005/02/trustswa=wsignin1.0&wresult=(RtXMLR!R4RRtADFS_ASSERTION_XPATHtADFS_TOKEN_NAMESPACESR+treplaceRtparsetquoteRR,t_prepare_sp_requestR7tencoded_assertion(Rt assertion((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyttest_prepare_sp_request{s     cCsdti|iƒ}|iid|id|ddƒ|iiƒ|it i |ii |i ƒdS(sÔTest proper parsing XML fault after bad authentication. An exceptions.AuthorizationFailure should be raised including error message from the XML message indicating where was the problem. tPOSTR#R$iôN( RR'R"R%t register_uriRRR(t assertRaisesRtAuthorizationFailureR)R*(RR#((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyt'test_get_adfs_security_token_authn_fails     cCsR|iid|iddddƒ|iiƒ|iti|ii|i ƒdS(søTest proper handling HTTP 500 and mangled (non XML) response. This should never happen yet, keystoneauth1 should be prepared and correctly raise exceptions.InternalServerError once it cannot parse XML fault message RNR#sNOT XMLR$iôN( R%RORRR(RPRtInternalServerErrorR)R*(R((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyt)test_get_adfs_security_token_bad_response£s     cCsŠtiƒi}|ii|idh|d6ddƒ|iƒ|i_|ii ƒ|ii |i ƒ|i dt |i i iƒƒdS(s Test whether SP issues a cookie.theaderss set-cookieR$i.iN(tuuidtuuid4thexR%R&Rt_build_adfs_requestRR,RJt#_send_assertion_to_service_providerR*R7tlentcookies(Rtcookie((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyRZµs  cCsd|iid|iddƒti|iƒ|i_|iiƒ|i t i |ii |i ƒdS(NRNR$iô(R%RORRRDR!RR,RJRPRRSRZR*(R((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyt2test_send_assertion_to_service_provider_bad_statusÃs  cCs2g|ii_|iti|ii|iƒdS(N(R*R\RPRRQRt_access_service_provider(R((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyttest_access_sp_no_cookies_failÐs  cCs—|iid|idtidtiƒtƒg|ii_ |i i |iƒ|i i }|i ti|iƒ|i tid|iƒdƒdS(NtGETtjsonRUttoken(R%RORtsaml2_fixturestUNSCOPED_TOKENRtAUTH_RESPONSE_HEADERStobjectR*R\RR_tauthenticated_responseR7RURb(Rtresponse((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyt)test_check_valid_token_when_authenticatedØs       cCsº|iid|id|iddƒ|iid|idhdd6ddƒ|iid |id tidti ƒt ƒg|i i _ |i i|i ƒ}|iti|iƒdS( NRNR#R$iÈRUtxs set-cookiei.RaRb(R%RORR!RRRdReRRfRgR*R\Rt get_auth_refR7tAUTH_SUBJECT_TOKENt auth_token(RRc((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyttest_end_to_end_workflowès          (t__name__t __module__tGROUPR6R5R;RAR>RVRWRXRRtpropertyRRR1R:R=R@RCRMRRRTRZR^R`RjRo(((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyRs:             (RVtlxmlRt six.movesRt keystoneauth1Rtkeystoneauth1.extrasRRtkeystoneauth1.tests.unitRt%keystoneauth1.tests.unit.extras.saml2RRdRRtTestCaseR(((s[/tmp/pip-build-wCUybK/keystoneauth1/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.pyt s