Skip to content

Commit 55859f6

Browse files
committed
Fixed tests ! Missed changing claim names. In configuration *_supported names must be used.
1 parent d2487f6 commit 55859f6

13 files changed

+29
-29
lines changed

src/idpyoidc/client/claims/oauth2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
class Claims(claims.Claims):
88
_supports = {
99
"redirect_uris": None,
10-
"grant_types": ["authorization_code", "implicit", "refresh_token"],
11-
"response_types": ["code"],
10+
"grant_types_supported": ["authorization_code", "implicit", "refresh_token"],
11+
"response_types_supported": ["code"],
1212
"client_id": None,
1313
'client_secret': None,
1414
"client_name": None,

src/idpyoidc/client/claims/transform.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,13 @@ def preferred_to_registered(prefers: dict, supported: dict,
159159
registered[key] = val
160160
else:
161161
logger.warning(
162-
f'OP tells me to do something I do not support: (key) = {val} not within '
162+
f'OP tells me to do something I do not support: {key} = {val} not within '
163163
f'{_supports}')
164164
_val = _intersection(val, _supports)
165165
if _val:
166166
registered[key] = _val
167167
else:
168-
raise ValueError('Not able to support the OPs choice')
168+
raise ValueError(f'Not able to support the OPs choice: {key}={val}')
169169
else:
170170
registered[key] = val # Should I just accept with the OP says ??
171171

tests/private/token_jwks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"keys": [{"kty": "oct", "use": "enc", "kid": "code", "k": "vSHDkLBHhDStkR0NWu8519rmV5zmnm5_"}, {"kty": "oct", "use": "enc", "kid": "refresh", "k": "Nazjj3RrR-yyo33HAWFbMYrH7rhwD77V"}]}
1+
{"keys": [{"kty": "oct", "use": "enc", "kid": "code", "k": "vSHDkLBHhDStkR0NWu8519rmV5zmnm5_"}, {"kty": "oct", "use": "enc", "kid": "refresh", "k": "pwcNBtEhyGiqrg0OeikHmSnTRs8_LZrc"}]}

tests/pub_client.jwks

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"keys": [{"kty": "EC", "use": "sig", "kid": "azZQQ2FEQjh3QnVZWVdrbHJkMEZSaWR6aVJ0LTBjeUFfeWRlbTRrRFZ5VQ", "crv": "P-256", "x": "2ADe18caWWGp6hpRbfa9HqQHDFNpid9xUmR56Wzm_wc", "y": "HnD_8QBanz4Y-UF8mKQFZXfqkGkXUSm34mLsdDKtSyk"}, {"kty": "RSA", "use": "sig", "kid": "SHEyYWcwNVk0LTdROTZzZ2FUWndIVXdack0xWUM5SEpwcS03dVUxWU4zRQ", "n": "rRz52ddyP9Y2ezSlRsnkt-sjXfV_Ii7vOFX-cStLE3IUlVeSJGEe_kAASLr2r3BE2unjntaxj67NP8D95h_rzG1SpCklTEn-aTe3FOwNyTzUH_oiDVeRoEcf04Y43ciRGYRB5PhI6ii-2lYuig6hyUr776Qxiu6-0zw-M_ay2MgGSy5CEj55dDSvcUyxStUObxGpPWnEvybO1vnE7iJEWGNe0L5uPe5nLidOiR-JwjxSWEx1xZYtIjxaf2Ulu-qu4hwgwBUQdx4bNZyBfljKj55skWuHqPMG3xMjnedQC6Ms5bR3rIkbBpvmgI3kJK-4CZikM6ruyLo94-Lk19aYQw", "e": "AQAB"}]}
1+
{"keys": [{"kty": "EC", "use": "sig", "kid": "azZQQ2FEQjh3QnVZWVdrbHJkMEZSaWR6aVJ0LTBjeUFfeWRlbTRrRFZ5VQ", "crv": "P-256", "x": "2ADe18caWWGp6hpRbfa9HqQHDFNpid9xUmR56Wzm_wc", "y": "HnD_8QBanz4Y-UF8mKQFZXfqkGkXUSm34mLsdDKtSyk"}, {"kty": "RSA", "use": "sig", "kid": "SHEyYWcwNVk0LTdROTZzZ2FUWndIVXdack0xWUM5SEpwcS03dVUxWU4zRQ", "e": "AQAB", "n": "rRz52ddyP9Y2ezSlRsnkt-sjXfV_Ii7vOFX-cStLE3IUlVeSJGEe_kAASLr2r3BE2unjntaxj67NP8D95h_rzG1SpCklTEn-aTe3FOwNyTzUH_oiDVeRoEcf04Y43ciRGYRB5PhI6ii-2lYuig6hyUr776Qxiu6-0zw-M_ay2MgGSy5CEj55dDSvcUyxStUObxGpPWnEvybO1vnE7iJEWGNe0L5uPe5nLidOiR-JwjxSWEx1xZYtIjxaf2Ulu-qu4hwgwBUQdx4bNZyBfljKj55skWuHqPMG3xMjnedQC6Ms5bR3rIkbBpvmgI3kJK-4CZikM6ruyLo94-Lk19aYQw"}]}

tests/pub_iss.jwks

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"keys": [{"kty": "EC", "use": "sig", "kid": "SmdKMlVGcG1zMnprdDdXZGpGWEczdHhlZVpGbkx1THpPdUY4d0w4bnZkSQ", "crv": "P-256", "x": "tRHJYm0fsOi0icpGEb33qiDVgt68ltMoYSWdLGhDGz4", "y": "fRpX0i6p5Jigf5I0qwW34PyStosMShwWAWS8x_w5o7E"}, {"kty": "RSA", "use": "sig", "kid": "R0FsaFdqREFaUFp1c0MwbUpsbHVSZ200blBJZWJVMTUtNGsyVlBmdHk5UQ", "n": "2ilgsKVqF92KfhwmosSVeZOaDgb3RF1mbg-pqkmLO6YpOO06LF4V4angF-GhP-ysAm2E75aSIU4tnHVThFlcxTgKFqjYKJQXyVzTVK2r-L2IbvFPaDtvoU6WteybpMlIUVk2po3cFDGObCWYKCm7CUOLlwH0uOpui66P9VSCqdKVKbJRAQBvTSbP10KWPxulfqjWGJtHO5fY7-JVWwOBkG-eHSJIT_uaoPjyvKCZjknq04bLUV9qP78KRQpRyYijBN60w2v8F79baN9CN10TIEjjWKGz0uX0M_YYQzTUoSY5l5ka9RkL3wT4o2iQ1t5nHphX6aA-gqwgCQmi-nvjaw", "e": "AQAB"}]}
1+
{"keys": [{"kty": "EC", "use": "sig", "kid": "SmdKMlVGcG1zMnprdDdXZGpGWEczdHhlZVpGbkx1THpPdUY4d0w4bnZkSQ", "crv": "P-256", "x": "tRHJYm0fsOi0icpGEb33qiDVgt68ltMoYSWdLGhDGz4", "y": "fRpX0i6p5Jigf5I0qwW34PyStosMShwWAWS8x_w5o7E"}, {"kty": "RSA", "use": "sig", "kid": "R0FsaFdqREFaUFp1c0MwbUpsbHVSZ200blBJZWJVMTUtNGsyVlBmdHk5UQ", "e": "AQAB", "n": "2ilgsKVqF92KfhwmosSVeZOaDgb3RF1mbg-pqkmLO6YpOO06LF4V4angF-GhP-ysAm2E75aSIU4tnHVThFlcxTgKFqjYKJQXyVzTVK2r-L2IbvFPaDtvoU6WteybpMlIUVk2po3cFDGObCWYKCm7CUOLlwH0uOpui66P9VSCqdKVKbJRAQBvTSbP10KWPxulfqjWGJtHO5fY7-JVWwOBkG-eHSJIT_uaoPjyvKCZjknq04bLUV9qP78KRQpRyYijBN60w2v8F79baN9CN10TIEjjWKGz0uX0M_YYQzTUoSY5l5ka9RkL3wT4o2iQ1t5nHphX6aA-gqwgCQmi-nvjaw"}]}

tests/test_08_transform.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def setup(self):
4242
self.supported = supported
4343

4444
def test_supported(self):
45-
assert 'token_endpoint_auth_methods_supported' not in self.supported
4645
# These are all the available configuration parameters
4746
assert set(self.supported.keys()) == {
4847
'acr_values_supported',
@@ -88,8 +87,8 @@ def test_supported(self):
8887
'scopes_supported',
8988
'sector_identifier_uri',
9089
'subject_types_supported',
91-
'token_endpoint_auth_method',
92-
# 'token_endpoint_auth_methods_supported',
90+
# 'token_endpoint_auth_method',
91+
'token_endpoint_auth_methods_supported',
9392
'token_endpoint_auth_signing_alg_values_supported',
9493
'tos_uri',
9594
'userinfo_encryption_alg_values_supported',
@@ -117,7 +116,6 @@ def test_oidc_setup(self):
117116
'require_request_uri_registration',
118117
'service_documentation',
119118
'token_endpoint',
120-
'token_endpoint_auth_methods_supported',
121119
'ui_locales_supported',
122120
'userinfo_endpoint'}
123121

@@ -147,7 +145,6 @@ def test_oidc_setup(self):
147145
'requests_dir',
148146
'require_auth_time',
149147
'sector_identifier_uri',
150-
'token_endpoint_auth_method',
151148
'tos_uri'}
152149

153150
claims = OIDC_Claims()
@@ -173,7 +170,7 @@ def test_oidc_setup(self):
173170
'response_types_supported',
174171
'scopes_supported',
175172
'subject_types_supported',
176-
'token_endpoint_auth_method',
173+
'token_endpoint_auth_methods_supported',
177174
'token_endpoint_auth_signing_alg_values_supported',
178175
'userinfo_encryption_alg_values_supported',
179176
'userinfo_encryption_enc_values_supported',
@@ -187,7 +184,7 @@ def test_oidc_setup(self):
187184
reg_claim.append(key)
188185

189186
assert set(RegistrationRequest.c_param.keys()).difference(set(reg_claim)) == {
190-
'post_logout_redirect_uri', 'token_endpoint_auth_method'}
187+
'post_logout_redirect_uri'}
191188

192189
# Which ones are list -> singletons
193190

@@ -250,7 +247,7 @@ def test_provider_info(self):
250247
'response_types_supported',
251248
'scopes_supported',
252249
'subject_types_supported',
253-
'token_endpoint_auth_method',
250+
'token_endpoint_auth_methods_supported',
254251
'token_endpoint_auth_signing_alg_values_supported',
255252
'userinfo_encryption_alg_values_supported',
256253
'userinfo_encryption_enc_values_supported',
@@ -350,6 +347,7 @@ def test_registration_response(self):
350347
'request_object_signing_alg',
351348
'response_types',
352349
'subject_type',
350+
'token_endpoint_auth_method',
353351
'token_endpoint_auth_signing_alg',
354352
'userinfo_signed_response_alg'}
355353

tests/test_09_work_condition.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def test_registration_response(self):
175175
'request_object_signing_alg',
176176
'response_types',
177177
'subject_type',
178+
'token_endpoint_auth_method',
178179
'token_endpoint_auth_signing_alg',
179180
'userinfo_signed_response_alg'}
180181

tests/test_client_02b_entity_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_create_client():
8787
'response_types_supported',
8888
'scopes_supported',
8989
'subject_types_supported',
90-
'token_endpoint_auth_method',
90+
'token_endpoint_auth_methods_supported',
9191
'token_endpoint_auth_signing_alg_values_supported',
9292
'userinfo_signing_alg_values_supported'}
9393

tests/test_client_21_oidc_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def create_service(self):
487487
"response_types_supported": ["code"],
488488
"request_object_signing_alg_values_supported": ["ES256"],
489489
"encrypt_id_token_supported": False, # default
490-
"token_endpoint_auth_method": ["private_key_jwt"],
490+
"token_endpoint_auth_methods_supported": ["private_key_jwt"],
491491
"token_endpoint_auth_signing_alg_values_supported": ["ES256"],
492492
"userinfo_signing_alg_values_supported": ["ES256"],
493493
"post_logout_redirect_uris": ["https://rp.example.com/post"],

tests/test_client_26_read_registration.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import json
22
import time
33

4+
from cryptojwt.utils import as_bytes
45
import pytest
6+
import requests
57
import responses
6-
from cryptojwt.utils import as_bytes
78

8-
import requests
99
from idpyoidc.client.entity import Entity
1010
from idpyoidc.message.oidc import RegistrationResponse
1111

@@ -22,18 +22,20 @@ def create_request(self):
2222
"requests_dir": "requests",
2323
"base_url": "https://example.com/cli/",
2424
"application_type": "web",
25-
"response_types": ["code"],
25+
"response_types_supported": ["code"],
2626
"contacts": ["[email protected]"],
2727
"jwks_uri": "https://example.com/rp/static/jwks.json",
2828
"redirect_uris": ["{}/authz_cb".format(RP_BASEURL)],
29-
"token_endpoint_auth_method": "client_secret_basic",
30-
"grant_types": ["authorization_code"],
29+
"token_endpoint_auth_methods_supported": ["client_secret_basic"],
30+
"grant_types_supported": ["authorization_code"],
3131
}
3232
services = {
3333
"registration": {"class": "idpyoidc.client.oidc.registration.Registration"},
3434
"read_registration": {
3535
"class": "idpyoidc.client.oidc.read_registration.RegistrationRead"
3636
},
37+
'authorization': {'class': 'idpyoidc.client.oidc.authorization.Authorization'},
38+
'accesstoken': {'class': 'idpyoidc.client.oidc.access_token.AccessToken'}
3739
}
3840

3941
self.entity = Entity(config=client_config, services=services)

0 commit comments

Comments
 (0)