Skip to content

Commit b0469b6

Browse files
committed
Fixed references.
Set correct service_name.
1 parent a43b65c commit b0469b6

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

src/idpyoidc/client/defaults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919

2020
DEFAULT_OAUTH2_SERVICES = {
21-
"discovery": {"class": "idpyoidc.client.oauth2.provider_info_discovery.ProviderInfoDiscovery"},
21+
"discovery": {"class": "idpyoidc.client.oauth2.server_metadata.ServerMetadata"},
2222
"authorization": {"class": "idpyoidc.client.oauth2.authorization.Authorization"},
2323
"access_token": {"class": "idpyoidc.client.oauth2.access_token.AccessToken"},
2424
"refresh_access_token": {

src/idpyoidc/client/oidc/provider_info_discovery.py

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

33
from idpyoidc.client.exception import ConfigurationError
4-
from idpyoidc.client.oauth2 import provider_info_discovery
4+
from idpyoidc.client.oauth2 import server_metadata
55
from idpyoidc.message import oidc
66
from idpyoidc.message.oauth2 import ResponseMessage
77

@@ -61,14 +61,16 @@ def add_redirect_uris(request_args, service=None, **kwargs):
6161
return request_args, {}
6262

6363

64-
class ProviderInfoDiscovery(provider_info_discovery.ProviderInfoDiscovery):
64+
class ProviderInfoDiscovery(server_metadata.ServerMetadata):
6565
msg_type = oidc.Message
6666
response_cls = oidc.ProviderConfigurationResponse
6767
error_msg = ResponseMessage
68+
service_name = "provider_info"
69+
6870
metadata_attributes = {}
6971

7072
def __init__(self, client_get, conf=None):
71-
provider_info_discovery.ProviderInfoDiscovery.__init__(self, client_get, conf=conf)
73+
server_metadata.ServerMetadata.__init__(self, client_get, conf=conf)
7274

7375
def update_service_context(self, resp, **kwargs):
7476
_context = self.client_get("service_context")

tests/test_client_40_dpop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def create_client(self):
8888

8989
services = {
9090
"discovery": {
91-
"class": "idpyoidc.client.oauth2.provider_info_discovery.ProviderInfoDiscovery"
91+
"class": "idpyoidc.client.oauth2.server_metadata.ServerMetadata"
9292
},
9393
"authorization": {"class": "idpyoidc.client.oauth2.authorization.Authorization"},
9494
"access_token": {"class": "idpyoidc.client.oauth2.access_token.AccessToken"},

tests/test_server_24_oauth2_token_endpoint.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,9 @@ def test_do_refresh_access_token_not_allowed(self):
689689
_request = REFRESH_TOKEN_REQ.copy()
690690
_request["refresh_token"] = _resp["response_args"]["refresh_token"]
691691
_req = self.token_endpoint.parse_request(_request.to_json())
692-
with pytest.raises(MintingNotAllowed):
693-
self.token_endpoint.process_request(_req)
692+
res = self.token_endpoint.process_request(_req)
693+
assert "error" in res
694+
assert res["error_description"] == 'Minting of access_token not supported'
694695

695696
def test_do_refresh_access_token_revoked(self):
696697
areq = AUTH_REQ.copy()

tests/test_server_35_oidc_token_endpoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -905,8 +905,8 @@ def test_do_refresh_access_token_not_allowed(self):
905905
_request = REFRESH_TOKEN_REQ.copy()
906906
_request["refresh_token"] = _resp["response_args"]["refresh_token"]
907907
_req = self.token_endpoint.parse_request(_request.to_urlencoded())
908-
with pytest.raises(MintingNotAllowed):
909-
self.token_endpoint.process_request(_req)
908+
res = self.token_endpoint.process_request(_req)
909+
assert "error" in res
910910

911911
def test_do_refresh_access_token_revoked(self):
912912
areq = AUTH_REQ.copy()

0 commit comments

Comments
 (0)