-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathtest_server_01_construct.py
More file actions
32 lines (28 loc) · 1.31 KB
/
test_server_01_construct.py
File metadata and controls
32 lines (28 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import pytest
from idpyoidc.server.construct import construct_provider_info
def test_construct():
default_capabilities = {
"claims_parameter_supported": True,
"request_parameter_supported": True,
"request_uri_parameter_supported": True,
"response_types_supported": ["code", "token", "code token"],
"response_modes_supported": ["query", "fragment", "form_post"],
"request_object_signing_alg_values_supported": None,
"request_object_encryption_alg_values_supported": None,
"request_object_encryption_enc_values_supported": None,
"grant_types_supported": ["authorization_code", "implicit"],
"scopes_supported": [],
}
_info = construct_provider_info(
default_capabilities,
request_object_signing_alg_values_supported=["RS256", "RS384", "RS512"],
grant_types_supported=["authorization_code"],
)
assert _info["request_object_signing_alg_values_supported"] == ["RS256", "RS384", "RS512"]
assert _info["grant_types_supported"] == ["authorization_code"]
assert "A128KW" in _info["request_object_encryption_alg_values_supported"]
with pytest.raises(ValueError):
_info = construct_provider_info(
default_capabilities,
request_object_encryption_alg_values_supported=["X"],
)