Skip to content

Commit 3690e6b

Browse files
authored
Merge pull request #87 from IdentityPython/id_assurance
Id assurance
2 parents 7364f05 + 1be342b commit 3690e6b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+587
-231
lines changed

example/flask_op/config.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,8 @@
208208
"request_uri_parameter_supported": true,
209209
"response_types_supported": [
210210
"code",
211-
"token",
212211
"id_token",
213-
"code token",
214-
"code id_token",
215-
"id_token token",
216-
"code id_token token",
217-
"none"
212+
"code id_token"
218213
],
219214
"response_modes_supported": [
220215
"query",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"keys": [{"kty": "oct", "use": "enc", "kid": "enc", "k": "gVdGvOn9TFG38gzqs2uO-pQB40qxJbfm"}, {"kty": "oct", "use": "sig", "kid": "sig", "k": "HlW_dFC6aquKPZ6zGtq2dZEBcntP9uHd"}]}
1+
{"keys": [{"kty": "oct", "use": "enc", "kid": "enc", "k": "GCizp3ewVRV0VZEef3VQwFve7n2QwAFI"}, {"kty": "oct", "use": "sig", "kid": "sig", "k": "QC2JxpVJXPDMpYv_h76jIrt_lA1P4KSu"}]}

example/flask_rp/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def init_oidc_rp_handler(app):
1616
if _rp_conf.key_conf:
1717
_kj = init_key_jar(**_rp_conf.key_conf)
1818
_path = _rp_conf.key_conf['public_path']
19-
# removes ./ and / from the begin of the string
19+
# removes ./ and / from the begining of the string
2020
_path = re.sub('^(.)/', '', _path)
2121
else:
2222
_kj = KeyJar()

example/flask_rp/config.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -87,26 +87,26 @@
8787
},
8888
"clients": {
8989
"": {
90-
"client_preferences": {
90+
"httpc_params": {
91+
"verify": false
92+
},
93+
"client_type": "oidc",
94+
"capabilities": {
9195
"application_name": "rphandler",
92-
"metadata": {
93-
"application_type": "web",
94-
"contacts": [
95-
96-
],
97-
"response_types": [
98-
"code"
99-
]
100-
},
101-
"usage": {
102-
"scope": [
103-
"openid",
104-
"profile",
105-
"email",
106-
"address",
107-
"phone"
108-
]
109-
},
96+
"application_type": "web",
97+
"contacts": [
98+
99+
],
100+
"response_types_supported": [
101+
"code"
102+
],
103+
"scopes_supported": [
104+
"openid",
105+
"profile",
106+
"email",
107+
"address",
108+
"phone"
109+
],
110110
"token_endpoint_auth_methods": [
111111
"client_secret_basic",
112112
"client_secret_post"

example/flask_rp/templates/opbyuid.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h3>By entering your unique identifier:</h3>
1919
<input type="text" id="uid" name="uid" class="form-control" placeholder="UID" autofocus>
2020
<h3>an issuer ID</h3>
2121
<input type="text" id="dyn_iss" name="dyn_iss" class="form-control">
22-
<h3><em>Or</em> you can chose one of the preconfigured OpenID Connect Providers</h3>
22+
<h3><em>Or</em> you can choose one of the preconfigured OpenID Connect Providers</h3>
2323
<select name="static_iss">
2424
<option value=""></option>
2525
{% for op in providers %}

example/flask_rp/views.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def rp():
6767
except Exception as err:
6868
return make_response('Something went wrong:{}'.format(err), 400)
6969
else:
70-
response = redirect(result['url'], 303)
70+
response = redirect(result, 303)
7171
return response
7272
else:
7373
_providers = current_app.rp_config.clients.keys()
@@ -106,7 +106,7 @@ def finalize(op_identifier, request_args):
106106
session['state'] = request_args.get('state')
107107

108108
if session['state']:
109-
iss = _context.state.get_iss(session['state'])
109+
iss = _context.cstate.get_set(session['state'], claim=["iss"])['iss']
110110
else:
111111
return make_response('Unknown state', 400)
112112

@@ -158,14 +158,9 @@ def get_op_identifier_by_cb_uri(url: str):
158158
uri = splitquery(url)[0]
159159
for k, v in current_app.rph.issuer2rp.items():
160160
for endpoint in v.get_callback_uris():
161-
_endps = v.get_metadata_value(endpoint)
162-
if _endps is None:
163-
continue
164-
elif isinstance(_endps,str):
165-
if _endps == uri:
161+
for val in v.context.claims.get_preference(endpoint):
162+
if val == uri:
166163
return k
167-
elif uri in _endps:
168-
return k
169164
return None
170165

171166
@oidc_rp_views.route('/authz_cb/<op_identifier>')

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ build-backend = "setuptools.build_meta"
77

88
[metadata]
99
name = "idpyoidc"
10-
version = "2.1.0"
10+
version = "3.0.0"
1111
author = "Roland Hedberg"
1212
author_email = "[email protected]"
1313
description = "Everything OAuth2 and OIDC"
1414
long_description = "file: README.md"
1515
long_description_content_type = "text/markdown"
16-
url = "https://github.com/IdentityPython/oidc-op"
16+
url = "https://github.com/IdentityPython/idpy-oidc"
1717
license = "Apache-2.0"
1818
classifiers =[
1919
"Programming Language :: Python :: 3",
@@ -31,7 +31,7 @@ line-length = 100
3131

3232
[tool.isort]
3333
force_single_line = true
34-
known_first_party = "oidcop"
34+
known_first_party = "idpyoidc"
3535
include_trailing_comma = true
3636
force_grid_wrap = 0
3737
use_parentheses = true

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def run_tests(self):
7070
"Programming Language :: Python :: 3.11",
7171
"Topic :: Software Development :: Libraries :: Python Modules"],
7272
install_requires=[
73-
"cryptojwt>=1.8.1",
73+
"cryptojwt>=1.8.3",
7474
"pyOpenSSL",
7575
"filelock>=3.0.12",
7676
'pyyaml>=5.1.2',

src/idpyoidc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Roland Hedberg"
2-
__version__ = "2.2.0"
2+
__version__ = "3.0.0"
33

44
VERIFIED_CLAIM_PREFIX = "__verified"
55

src/idpyoidc/claims.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def add_extra_keys(self, keyjar, id):
132132
return None
133133

134134
def get_jwks(self, keyjar):
135-
return None
135+
return keyjar.export_jwks()
136136

137137
def handle_keys(self, configuration: dict, keyjar: Optional[KeyJar] = None):
138138
_jwks = _jwks_uri = None

0 commit comments

Comments
 (0)