forked from keitaroinc/ckanext-saml2auth
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow authentication context requests
- Loading branch information
1 parent
6670cd0
commit 663a587
Showing
5 changed files
with
100 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,7 @@ idp.xml | |
.vscode/ | ||
.pre-commit-config.yaml | ||
.flake8 | ||
|
||
*.pem | ||
test-signed.xml | ||
test-signed-encrypted.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# encoding: utf-8 | ||
import os | ||
import pytest | ||
from ckanext.saml2auth.views.saml2auth import saml2login | ||
|
||
|
||
here = os.path.dirname(os.path.abspath(__file__)) | ||
extras_folder = os.path.join(here, 'extras') | ||
|
||
|
||
@pytest.mark.ckan_config(u'ckanext.saml2auth.requested_authn_context_comparison', 'bad_value') | ||
@pytest.mark.ckan_config(u'ckanext.saml2auth.requested_authn_context', 'req1 req2') | ||
@pytest.mark.ckan_config(u'ckanext.saml2auth.idp_metadata.location', u'local') | ||
@pytest.mark.ckan_config(u'ckanext.saml2auth.idp_metadata.local_path', | ||
os.path.join(extras_folder, 'provider0', 'idp.xml')) | ||
def test_empty_comparison(): | ||
with pytest.raises(ValueError) as e: | ||
saml2login() | ||
assert 'Unexpected comparison' in e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters