Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit e15456b

Browse files
committed
Remove statically configured endpoints.
1 parent 0c31a46 commit e15456b

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

.pytest_cache/v/cache/lastfailed

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"tests/test_14_oidc.py::TestClient::()::test_service_request": true,
33
"tests/test_20_rp_handler.py::TestRPHandler::()::test_get_accesstoken": true,
4-
"tests/test_20_rp_handler.py::TestRPHandler::()::test_get_userinfo": true
4+
"tests/test_20_rp_handler.py::TestRPHandler::()::test_get_userinfo": true,
5+
"tests/test_20_rp_handler.py::TestRPHandler::test_support_webfinger": true
56
}

src/oidcrp/__init__.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,18 @@ def do_provider_info(self, client=None, state=''):
226226
return client.service_context.provider_info['issuer']
227227
else:
228228
_pi = client.service_context.provider_info
229-
for endp in ['authorization_endpoint', 'token_endpoint',
230-
'userinfo_endpoint']:
231-
if endp in _pi:
232-
for srv in client.service.values():
233-
if srv.endpoint_name == endp:
234-
srv.endpoint = _pi[endp]
229+
for key, val in _pi.items():
230+
# All service endpoint parameters in the provider info has
231+
# a name ending in '_endpoint' so I can look specifically
232+
# for those
233+
if key.endswith("_endpoint"):
234+
for _srv in client.service_context.service.values():
235+
# Every service has an endpoint_name assigned
236+
# when initiated. This name *MUST* match the
237+
# endpoint names used in the provider info
238+
if _srv.endpoint_name == key:
239+
_srv.endpoint = val
240+
235241
try:
236242
return client.service_context.provider_info['issuer']
237243
except KeyError:

0 commit comments

Comments
 (0)