Skip to content

Commit

Permalink
💚 [#94] Update broken tests
Browse files Browse the repository at this point in the history
Tests no longer reflected the current implementation.
  • Loading branch information
sergei-maertens committed May 1, 2024
1 parent c391ccb commit 308e228
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
20 changes: 10 additions & 10 deletions tests/test_admin_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def test_derive_endpoints_success():
"oidc_rp_sign_algo": "RS256",
"oidc_op_discovery_endpoint": "http://discovery-endpoint.nl/",
"claim_mapping": get_claim_mapping(),
"groups_claim": "roles",
"groups_claim": ["roles"],
"sync_groups_glob_pattern": "*",
"username_claim": "sub",
"username_claim": ["sub"],
"oidc_nonce_size": 32,
"oidc_state_size": 32,
"userinfo_claims_source": UserInformationClaimsSources.id_token,
Expand Down Expand Up @@ -71,9 +71,9 @@ def test_derive_endpoints_extra_field():
"oidc_rp_sign_algo": "RS256",
"oidc_op_discovery_endpoint": "http://discovery-endpoint.nl/",
"claim_mapping": get_claim_mapping(),
"groups_claim": "roles",
"groups_claim": ["roles"],
"sync_groups_glob_pattern": "*",
"username_claim": "sub",
"username_claim": ["sub"],
"oidc_nonce_size": 32,
"oidc_state_size": 32,
"userinfo_claims_source": UserInformationClaimsSources.id_token,
Expand Down Expand Up @@ -119,9 +119,9 @@ def test_derive_endpoints_request_error(*m):
"oidc_rp_sign_algo": "RS256",
"oidc_op_discovery_endpoint": "http://discovery-endpoint.nl",
"claim_mapping": get_claim_mapping(),
"groups_claim": "roles",
"groups_claim": ["roles"],
"sync_groups_glob_pattern": "*",
"username_claim": "sub",
"username_claim": ["sub"],
"oidc_nonce_size": 32,
"oidc_state_size": 32,
"userinfo_claims_source": UserInformationClaimsSources.id_token,
Expand All @@ -145,9 +145,9 @@ def test_derive_endpoints_json_error(*m):
"oidc_rp_sign_algo": "RS256",
"oidc_op_discovery_endpoint": "http://discovery-endpoint.nl",
"claim_mapping": get_claim_mapping(),
"groups_claim": "roles",
"groups_claim": ["roles"],
"sync_groups_glob_pattern": "*",
"username_claim": "sub",
"username_claim": ["sub"],
"oidc_nonce_size": 32,
"oidc_state_size": 32,
"userinfo_claims_source": UserInformationClaimsSources.id_token,
Expand All @@ -169,9 +169,9 @@ def test_no_discovery_endpoint_other_fields_required():
"oidc_rp_client_secret": "secret",
"oidc_rp_sign_algo": "RS256",
"claim_mapping": get_claim_mapping(),
"groups_claim": "roles",
"groups_claim": ["roles"],
"sync_groups_glob_pattern": "*",
"username_claim": "sub",
"username_claim": ["sub"],
"oidc_nonce_size": 32,
"oidc_state_size": 32,
"userinfo_claims_source": UserInformationClaimsSources.id_token,
Expand Down
8 changes: 7 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def test_obfuscate_non_string():
def test_obfuscate_nested():
claims = {
"foo": "not_obfuscated",
"foo.bar": "obfuscated",
"some": {
"nested": {
"claim": "obfuscated",
Expand All @@ -29,9 +30,14 @@ def test_obfuscate_nested():
"bar": "obfuscated",
},
}
claims_to_obfuscate = ["some.nested.claim", "object"]
claims_to_obfuscate = [
["foo.bar"],
["some", "nested", "claim"],
["object"],
]
expected_result = {
"foo": "not_obfuscated",
"foo.bar": "********ed",
"some": {"nested": {"claim": "********ed", "claim2": "not_obfuscated"}},
"object": {"foo": "********ed", "bar": "********ed"},
}
Expand Down

0 comments on commit 308e228

Please sign in to comment.