Pulled out all name_id related stuff into an own class
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from saml2.server import Server, IdentifierMap
|
||||
from saml2.server import Server, Identifier
|
||||
from saml2 import server, make_instance
|
||||
from saml2 import samlp, saml, client, utils
|
||||
from saml2.utils import OtherError
|
||||
@@ -13,15 +13,6 @@ import re
|
||||
def _eq(l1,l2):
|
||||
return set(l1) == set(l2)
|
||||
|
||||
def test_persistence_0():
|
||||
id = IdentifierMap("subject_data.db")
|
||||
|
||||
pid1 = id.persistent("urn:mace:example.com:saml:roland:sp", "jeter")
|
||||
pid2 = id.persistent("urn:mace:example.com:saml:roland:sp", "jeter")
|
||||
|
||||
print pid1, pid2
|
||||
assert pid1 == pid2
|
||||
|
||||
class TestServer1():
|
||||
def setup_class(self):
|
||||
# try:
|
||||
@@ -175,11 +166,13 @@ class TestServer1():
|
||||
assert response["sp_entityid"] == "urn:mace:example.com:saml:roland:sp"
|
||||
|
||||
def test_sso_response_with_identity(self):
|
||||
name_id = self.server.id.temporary_nameid()
|
||||
resp = self.server.do_response(
|
||||
"http://localhost:8087/", # consumer_url
|
||||
"12", # in_response_to
|
||||
"urn:mace:example.com:saml:roland:sp", # sp_entity_id
|
||||
{ "eduPersonEntitlement": "Short stop"}
|
||||
{ "eduPersonEntitlement": "Short stop"}, # identity
|
||||
name_id
|
||||
)
|
||||
|
||||
print resp.keyswv()
|
||||
|
||||
@@ -49,11 +49,14 @@ REQ1 = """<?xml version='1.0' encoding='UTF-8'?>
|
||||
class TestClient:
|
||||
def setup_class(self):
|
||||
server = Server("idp.config")
|
||||
name_id = server.id.temporary_nameid()
|
||||
|
||||
self._resp_ = server.do_response(
|
||||
"http://lingon.catalogix.se:8087/", # consumer_url
|
||||
"12", # in_response_to
|
||||
"urn:mace:example.com:saml:roland:sp", # sp_entity_id
|
||||
{"eduPersonEntitlement":"Jeter"}
|
||||
{"eduPersonEntitlement":"Jeter"},
|
||||
name_id = name_id
|
||||
)
|
||||
|
||||
conf = config.Config()
|
||||
|
||||
Reference in New Issue
Block a user