Skip to content

Commit

Permalink
fix: regression after idp eid changed from :8080 to :8443
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Nov 14, 2024
1 parent 6dab130 commit 04b41a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/spid_sp_test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


BASE_DIR = Path(__file__).resolve().parent
__version__ = "1.2.16"
__version__ = "1.2.17"
__name__ = "spid_sp_test"
logger = logging.getLogger(__name__)

Expand Down
14 changes: 8 additions & 6 deletions tests/test_02_authn.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
CMD = BASE_CMD + " --extra --metadata-url file://tests/metadata/{} --authn-url file://tests/authn/{} --debug ERROR"


def run_cmd(mfname, metadata = BASE_METADATA, profile="spid-sp-public") -> int:
def run_cmd(mfname, metadata = BASE_METADATA, profile="spid-sp-public", environ="") -> int:
cmd = CMD.format(metadata, mfname)
return os.system(f'{cmd} --profile {profile}')

return os.system(f'{environ}{cmd} --profile {profile}')

def test_django_post_html():
es = run_cmd('spid_django_post.html')
es = run_cmd('spid_django_post.html', environ="IDP_ENTITYID=https://localhost:8080 ")
assert es == 0


def test_django_post():
es = run_cmd('spid_django.xml')
es = run_cmd('spid_django.xml', environ="IDP_ENTITYID=https://localhost:8080 ")
assert es == 0


Expand All @@ -25,19 +24,22 @@ def test_django_redirect():
Must fail
ERROR:spid_sp_test.authn_request:The ProtocolBinding attribute must be urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST - TR pag. 8 : FAILED
"""
es = run_cmd('spid_django_redirect.url')
es = run_cmd('spid_django_redirect.url', environ="IDP_ENTITYID=https://localhost:8080 ")
assert es != 0


def test_spid_express_no_relaystate():
"""Must fail"""
es = run_cmd("spid_express_no_relaystate_redirect.url",
metadata = "spid_express_no_relaystate_metadata.xml")
assert es != 0


def test_django_post_wrong_signature():
es = run_cmd('spid_django_wrong_signature.xml')
assert es != 0


def test_L2():
"""Must fail"""
es = run_cmd("tests/authn/spid_express_forceauthn_spid_level_2.url",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_03_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@


def test_all_default_responses():
es = os.system(CMD)
es = os.system(f"IDP_ENTITYID=https://localhost:8080 {CMD}")
assert es == 0

0 comments on commit 04b41a0

Please sign in to comment.