Skip to content

Commit

Permalink
fix: removed exceedent ACR check + unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Jun 9, 2021
1 parent b220467 commit 824bff3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def readme():

setup(
name='spid_sp_test',
version='0.6.6-1',
version='0.6.7',
description="SAML2 SPID Service Provider validation tool that can be run from the command line",
long_description=readme(),
long_description_content_type='text/markdown',
Expand Down
8 changes: 1 addition & 7 deletions src/spid_sp_test/authn_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,7 @@ def test_AuthnRequest_SPID(self):
description = acr_desc
)
value = req.get('ForceAuthn')
if not value:
self._assertTrue(
value,
'The ForceAuthn attribute MUST be present if ACR > L1',
**error_kwargs
)
else:
if value:
self._assertTrue(
(value.lower() in constants.BOOLEAN_TRUE),
'The ForceAuthn attribute MUST be true or 1 - TR pag. 8 ',
Expand Down
11 changes: 9 additions & 2 deletions tests/test_02_authn.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
CMD = BASE_CMD + " --extra --metadata-url file://tests/metadata/{} --authn-url file://tests/authn/{}"


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


def test_django_post_html():
Expand Down Expand Up @@ -36,3 +36,10 @@ def test_spid_express_no_relaystate():
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",
metadata = "spid_express_forceauthn_spid_level_2_metadata.xml",
profile="spid-sp-private")
assert es != 0

0 comments on commit 824bff3

Please sign in to comment.