Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
pysaml2 / tests / test_50_server.pyc
Size: Mime:
ó
6£ßNc@scddlmZmZddlmZmZmZmZddlmZddlm	Z	ddlm
Z
ddlmZddlm
Z
mZddlmZdd	lmZmZdd
lmZddlZd„Zd
fd„ƒYZdfd„ƒYZiddgd6dgd6dgd6dgd6Zdfd„ƒYZd„Zdfd„ƒYZdS(iÿÿÿÿ(tServert
Identifier(tsamlptsamltclienttconfig(ts_utils(tsigver(t	time_util(t
OtherError(tdo_attribute_statementtfactory(tmake_soap_enveloped_saml_thingy(tBINDING_HTTP_POSTtBINDING_HTTP_REDIRECT(traisesNcCst|ƒt|ƒkS(N(tset(tl1tl2((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyt_eqstTestIdentifiercBs,eZd„Zd„Zd„Zd„ZRS(cCstdƒ|_dS(Ns	foobar.db(Rtident(tself((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pytsetup_classscCsäd}|jj|dƒ}|jjƒ}|GH|jjGH|jj||ƒ}|dksat‚|jj|dƒdks‚t‚|jj|d|ƒdks§t‚|jj|dƒ}|jjƒ|jjƒksàt‚dS(Nsurn:mace:umu.se:sptabcd0001spseudo random strings:x(Rtpersistent_nameidttexttstriptmapt
local_nametAssertionErrortNone(Rtsp_idtnameidt	remote_idtlocaltnameid2((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyttest_persistent_nameids!%cCsäd}|jj|dƒ}|jjƒ}|GH|jjGH|jj||ƒ}|dksat‚|jj|dƒdks‚t‚|jj|d|ƒdks§t‚|jj|dƒ}|jjƒ|jjƒksàt‚dS(Nsurn:mace:umu.se:spRspseudo random strings:x(Rttransient_nameidRRRRRR(RR R!R"R#R$((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyttest_transient_nameid's!%cCs&tjjdƒr"tjdƒndS(Ns	foobar.db(tostpathtexiststunlink(R((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pytteardown_class6s(t__name__t
__module__RR%R'R,(((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyRs			tTestServer1cBs†eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„ZRS(cCs>tdƒ|_tjƒ}|jdƒtj|ƒ|_dS(Ntidp_conftserver_conf(RtserverRtSPConfigt	load_fileRtSaml2Client(Rtconf((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyR;s
cCs‚|jjƒ}t|tjƒs't‚t|jƒddgƒsHt‚|jtj	ks`t‚|j
|jjjks~t‚dS(NRtformat(
R2tissuert
isinstanceRtIssuerRRtkeyswvR7tNAMEID_FORMAT_ENTITYRR6tentityid(RR8((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyttest_issuerBs
!cCs(tjdttjdddttjdtjƒƒdtidd6dd6ƒd|jj	ƒƒ}t
|jƒddd
dddgƒst‚|j
dks¤t‚|j	jdks¼t‚|jsËt‚|j}t|jƒdksït‚|jd}|jd}|jdjd
krh|jdks4t‚|jd	ksIt‚|jdjdksÊt‚nb|jdks}t‚|jdjd
ks™t‚|jd	ks®t‚|jdjdksÊt‚|j}t
|jƒddgƒsôt‚|jdks	t‚|jjtjks$t‚dS(NtsubjectRt_aaatname_idR7tattribute_statementtJeterttsurNametDerekt	givenNameR8tidt
issue_instanttversions2.0s$urn:mace:example.com:saml:roland:idpiii(sJeterRD(RDRDssurName(sDerekRD(RDRDs	givenName(Rtassertion_factoryRRtSubjecttNameIDtNAMEID_FORMAT_TRANSIENTR
R2R8RR;RRJRRBtlent	attributetattribute_valuet
friendly_nameR?RAR7(Rt	assertionRBtattr0tattr1R?((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyttest_assertionJs:	
	

	!cCsHtjdddddtjƒdtjdttjdd	d
tjƒdt	idd6dd6ƒd|j
jƒƒd|j
jƒƒ}|jƒGHt
|jƒddddddddgƒsÄt‚|jdksÙt‚|jjdksñt‚|jdkst‚|jdkst‚|j}|GH|jjtjksDt‚dS(Ntin_response_tot_012345tdestinationshttps:#www.example.comtstatusRSR?RR@RARBRCRDRERFRGR8RIRJRHs2.0s$urn:mace:example.com:saml:roland:idp(sJeterRD(RDRDssurName(sDerekRD(RDRDs	givenName(Rtresponse_factoryRtsuccess_status_factoryRKRRRLRNR
R2R8R;RRRJRRYRWRZtstatus_codetvalueRtSTATUS_SUCCESS(RtresponseRZ((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyt
test_responseos.		
	cCsZ|jjddddddddd	d
ƒ}tjd|ƒ}tt|jj|ƒdS(Ntquery_idtid1RYshttp://www.example.comtservice_urlshttp://www.example.orgt
spentityids#urn:mace:example.com:saml:roland:sptmy_namesMy real names%s(Rt
authn_requestRtdeflate_and_base64_encodeRR	R2tparse_authn_request(RRgtintermed((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyttest_parse_faulty_requests	cCs2|jjddddddddd	d
ƒ}tjd|ƒ}y|jj|ƒd}Wn*tk
r†}|jGHtj	|ƒ}nX|s“t
‚|GHt|jƒdd
gƒs¹t
‚|j
jdksÑt
‚|j}t|jƒddgƒsût
‚|jtjkst
‚|jjtjks.t
‚dS(NRbRcRYshttp://www.example.comRdshttp://www.example.orgRes#urn:mace:example.com:saml:roland:spRfsMy real names%sR]tstatus_messagesNot destined for me!R^(RRgRRhR2RiRR	targsterror_status_factoryRRR;RlRR]R^RtSTATUS_RESPONDERtSTATUS_UNKNOWN_PRINCIPAL(RRgRjRZtoeR]((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyt'test_parse_faulty_request_to_err_statusšs*	
!	!cCsè|jjddddddddd	d
ƒ}|GHtjd|ƒ}|jj|ƒ}|GH|ddksrt‚|d
dksˆt‚|dj}t|j	ƒddgƒs¶t‚|j
tjksÎt‚|ddksät‚dS(NRbRcRYshttp://localhost:8088/ssoRdshttp://localhost:8087/Res#urn:mace:example.com:saml:roland:spRfsMy real names%stconsumer_urlRHtrequestR7tallow_createtsp_entity_id(
RRgRRhR2RiRtname_id_policyRR;R7RRN(RRgRjR`Rw((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyttest_parse_ok_request´s 	
!c
Csi|jjjddƒ}|jjdddidd6|ƒ}|jƒGHt|jƒdddd	d
ddd
gƒs{t‚|jdkst‚|jdks¥t‚|j	s´t‚|j	j
jtj
ksÒt‚|jsát‚|jsðt‚|j}|GH|js
t‚|jst‚|js+t‚|j}|GHt|jƒdksTt‚|jd}t|jƒdks|t‚|jdks‘t‚|jdks¦t‚|jdks»t‚|jd}|jjƒdksãt‚|jƒdksût‚|js
t‚|jjst‚|jjs.t‚|jj}|jƒGH|jGH|jjdkset‚dS(Ns#urn:mace:example.com:saml:roland:sptid12shttp://localhost:8087/s
Short stopteduPersonEntitlementRZRYRSRWRIRJRHR8iis urn:oid:1.3.6.1.4.1.5923.1.1.1.7s/urn:oasis:names:tc:SAML:2.0:attrname-format:uris	xs:string(R2RR&tdo_responseR;RRRYRWRZR]R^RR_RStauthn_statementt
conditionsRBRORPRQRRtnametname_formatRRtget_typeR?RAtsubject_confirmationtsubject_confirmation_data(RRAtrespRSRBRPR^tconfirmation((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyttest_sso_response_with_identityÉsT		
			

c	CsÖ|jjdddƒ}|jƒGHt|jƒdddddd	d
gƒsSt‚|jdksht‚|jdks}t‚|jsŒt‚|jjj	t
jksªt‚|jj
dksÂt‚|jsÒt‚dS(NRyshttp://localhost:8087/s#urn:mace:example.com:saml:roland:spRZRYRWRIRJRHR8s$urn:mace:example.com:saml:roland:idp(R2R{R;RRRYRWRZR]R^RR_R8RRS(RRƒ((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyt"test_sso_response_without_identity÷s		c	Cs,tjdƒ}|jjddd|ƒ}|jƒGHt|jƒddddd	d
dgƒset‚|jdkszt‚|jdkst‚|j	sžt‚|j	GH|j	j
jtj
ksÄt‚|j	j
j
jtjksåt‚|j	jjdkst‚|jjdkst‚|js(t‚dS(
NseduPersonAffiliation missingRyshttp://localhost:8087/s#urn:mace:example.com:saml:roland:spRZRYRWRIRJRHR8s$urn:mace:example.com:saml:roland:idp(RtMissingValueR2terror_responseR;RRRYRWRZR]R^RRotSTATUS_REQUEST_UNSUPPORTEDRlRR8RS(RtexcRƒ((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyttest_sso_failure_responses"c
Cspidgd6dgd6dgd6}|jj|ddd	tjd
tjddƒd
ƒ}tjdj|ƒƒ}|jƒGHt	|jƒddddddddgƒs°t
‚|jdjƒGHt|jƒdksÝt
‚t	|jdjƒddddddddgƒst
‚|jd}t|j
ƒdks?t
‚|j
d}|GHt|jƒdkslt
‚dS(NRFRGRCREsderek@nyy.mlb.comtmailRcshttp://local:8087/s#urn:mace:example.com:saml:roland:spR7Ruttruesfoba0001@example.coms
RZRYRSRWRIRJR8RHiiR|RBR?R}i(R2tauthn_responseRtNameIDPolicyRRNtresponse_from_stringtjoinR;RRRSRORBRP(Rtavatresp_strR`RStastate((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyttest_authn_response_0s.
			

c	Cs¢|jjjddƒ}|jjdddidd6d|dtƒ}d|GH|s[t‚t|jƒd	ksvt‚|jd
}|jj	j
dksžt‚dS(Ns#urn:mace:example.com:saml:roland:spRys http://lingon.catalogix.se:8087/RCRzRAtsigns%siiRD(R2RR&R{tTrueRRORSt	signaturetsignature_valueR(RRAtsigned_respRS((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyttest_signed_response7s		
		
c	Cs·tjddƒ}idd6dd6|d6idd	6d
d6d6}|jjj|ƒ|jjd
dddddddƒ}tjd|fƒ}|jj	|t
ƒ}|s³t‚dS(Ntdaysitfoba0001RAs$urn:mace:example.com:saml:roland:idpR8tnot_on_or_aftertLeoRGtLaportREtusert
subject_idRYshttp://localhost:8088/sloptissuer_entity_idtreasonsI'm tired of thiss%s(Rt
in_a_whileRtuserstadd_information_about_persontconstruct_logout_requestRRhR2tparse_logout_requestR
R(Rtsoontsinfotlogout_requestRjRt((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyttest_slo_http_postPs"	c		CsÕtjddƒ}idd6dd6|d6idd	6d
d6d6}tjd
dƒ}|jj|ƒ|jddddddddƒ}tjd|fƒ}t	|ƒ}t
dƒ}|j|ƒ}|sÑt‚dS(NRœiRRAs$urn:mace:example.com:saml:roland:idpR8RžRŸRGR RER¡tconfig_fileR1R¢RYshttp://localhost:8088/sloR£R¤sI'm tired of thiss%st
idp_soap_conf(
RR¥RR5R¦R§R¨RRhRRR©R(	RRªR«tspR¬t_t	saml_soaptidpRt((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyt
test_slo_soapis&	(R-R.RR>RVRaRkRrRxR…R†R‹R•R›R­R´(((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyR/:s			%		
			.					tstafftmemberteduPersonAffiliationRCRERFRGs
foo@gmail.comRŒtTestServer2cBseZd„Zd„ZRS(cCstdƒ|_dS(Ntrestrictive_idp_conf(RR2(R((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyR‹scCs)|jjj}|jGH|jjdddtjƒƒ}|dk	sJt‚|j	dks_t‚|j
dkstt‚|jdks‰t‚|jj
dks¡t‚|jjjtjks¿t‚|jsÎt‚|j}|jdksìt‚|j}|jst‚|j}|jj
dks%t‚dS(Ntaaashttp://example.com/sp/surn:mace:example.com:sp:1s2.0s%urn:mace:example.com:saml:roland:idpr(R2R6tpolicyt__dict__tdo_aa_responsetIDENTITYtcopyRRRYRWRJR8RRZR]R^RR_RSR?RR‚(Rt	aa_policyR`RSR?R((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyttest_do_aa_reponseŽs"			(R-R.RRÁ(((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyR¸Šs	c	Csœtjƒ}|j|ƒtj|ƒ}tjddƒ}idd6dd6|d6idd	6d
d6d6}|jj|ƒ|j	d
dddddddƒS(NRœiRRAs$urn:mace:example.com:saml:roland:idpR8RžRŸRGR RER¡R¢RYshttp://localhost:8088/sloR£R¤sI'm tired of this(
RR3R4RR5RR¥R¦R§R¨(t	conf_fileR6R°RªR«((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyt_logout_request£s"
	tTestServerLogoutcBseZd„ZRS(cCsžtdƒ}tdƒ}|GHtg}|j||ƒ\}}}|dksSt‚t|ƒdkskt‚|dddks…t‚|dgksšt‚dS(Ntidp_slo_redirect_conftsp_slo_redirect_confs	302 FoundiitLocationRD(RRÃRtlogout_responseRRO(RR2RttbindingsRƒtheaderstmessage((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyttest_1¼s	(R-R.RÌ(((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyRĺs(tsaml2.serverRRtsaml2RRRRRRRt
saml2.s_utilsR	R
Rt
saml2.soapRR
Rtpy.testRR(RRR/R¾R¸RÃRÄ(((s@/home/lgs/proyectos/yaco/pysaml2/pysaml2/tests/test_50_server.pyt<module>s("	&ÿM