Skip to content

Commit 7364f05

Browse files
authored
Merge pull request #83 from IdentityPython/ia0
Identity Assurance support has been out in the cold. Time to bring it in again.
2 parents 25c1a27 + 3d1aee7 commit 7364f05

File tree

99 files changed

+1487
-1066
lines changed

Some content is hidden

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

99 files changed

+1487
-1066
lines changed

demo/oauth2_add_on_dpop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from common import KEYDEFS
66
from common import full_path
77
from flow import Flow
8-
from idpyoidc.claims import get_signing_algs
8+
from idpyoidc.metadata import get_signing_algs
99
from idpyoidc.client.oauth2 import Client
1010
from idpyoidc.server import Server
1111
from idpyoidc.server.configure import ASConfiguration

demo/oidc_add_on_dpop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from common import KEYDEFS
66
from common import full_path
77
from flow import Flow
8-
from idpyoidc.claims import get_signing_algs
8+
from idpyoidc.metadata import get_signing_algs
99
from idpyoidc.client.oauth2 import Client
1010
from idpyoidc.server import Server
1111
from idpyoidc.server.configure import ASConfiguration

example/flask_op/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"server_info": {
4040
"add_on": {
4141
"pkce": {
42-
"function": "idpyoidc.server.oidc.add_on.pkce.add_pkce_support",
42+
"function": "idpyoidc.server.oauth2.add_on.pkce.add_support",
4343
"kwargs": {
4444
"essential": false,
4545
"code_challenge_method": "S256 S384 S512"

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.1.0"
2+
__version__ = "2.2.0"
33

44
VERIFIED_CLAIM_PREFIX = "__verified"
55

src/idpyoidc/claims.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
from functools import cmp_to_key
21
from typing import Callable
32
from typing import Optional
43

54
from cryptojwt import KeyJar
6-
from cryptojwt.jwe import SUPPORTED
7-
from cryptojwt.jws.jws import SIGNER_ALGS
85
from cryptojwt.key_jar import init_key_jar
96
from cryptojwt.utils import importer
107

@@ -215,42 +212,3 @@ def get_claim(self, key, default=None):
215212
return default
216213
else:
217214
return _val
218-
219-
220-
SIGNING_ALGORITHM_SORT_ORDER = ["RS", "ES", "PS", "HS"]
221-
222-
223-
def cmp(a, b):
224-
return (a > b) - (a < b)
225-
226-
227-
def alg_cmp(a, b):
228-
if a == "none":
229-
return 1
230-
elif b == "none":
231-
return -1
232-
233-
_pos1 = SIGNING_ALGORITHM_SORT_ORDER.index(a[0:2])
234-
_pos2 = SIGNING_ALGORITHM_SORT_ORDER.index(b[0:2])
235-
if _pos1 == _pos2:
236-
return (a > b) - (a < b)
237-
elif _pos1 > _pos2:
238-
return 1
239-
else:
240-
return -1
241-
242-
243-
def get_signing_algs():
244-
# Assumes Cryptojwt
245-
_list = list(SIGNER_ALGS.keys())
246-
# know how to do none but should not
247-
_list.remove("none")
248-
return sorted(_list, key=cmp_to_key(alg_cmp))
249-
250-
251-
def get_encryption_algs():
252-
return SUPPORTED["alg"]
253-
254-
255-
def get_encryption_encs():
256-
return SUPPORTED["enc"]

src/idpyoidc/client/claims/oidc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
from typing import Optional
44

5-
from idpyoidc import claims
5+
from idpyoidc import metadata
66
from idpyoidc.client import claims as client_claims
77
from idpyoidc.client.claims.transform import create_registration_request
88
from idpyoidc.message.oidc import RegistrationRequest
@@ -75,9 +75,9 @@ class Claims(client_claims.Claims):
7575
"encrypt_id_token_supported": None,
7676
# "grant_types_supported": ["authorization_code", "refresh_token"],
7777
"logo_uri": None,
78-
"id_token_signing_alg_values_supported": claims.get_signing_algs,
79-
"id_token_encryption_alg_values_supported": claims.get_encryption_algs,
80-
"id_token_encryption_enc_values_supported": claims.get_encryption_encs,
78+
"id_token_signing_alg_values_supported": metadata.get_signing_algs,
79+
"id_token_encryption_alg_values_supported": metadata.get_encryption_algs,
80+
"id_token_encryption_enc_values_supported": metadata.get_encryption_encs,
8181
"initiate_login_uri": None,
8282
"jwks": None,
8383
"jwks_uri": None,

src/idpyoidc/client/client_auth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212

1313
from idpyoidc.defaults import DEF_SIGN_ALG
1414
from idpyoidc.defaults import JWT_BEARER
15-
from idpyoidc.message.oauth2 import AccessTokenRequest
1615
from idpyoidc.message.oauth2 import SINGLE_OPTIONAL_STRING
16+
from idpyoidc.message.oauth2 import AccessTokenRequest
1717
from idpyoidc.message.oidc import AuthnToken
1818
from idpyoidc.time_util import utc_time_sans_frac
1919
from idpyoidc.util import rndstr
20-
from .util import sanitize
20+
2121
from ..message import VREQUIRED
2222
from ..util import instantiate
23+
from .util import sanitize
2324

2425
# from idpyoidc.oidc.backchannel_authentication import ClientNotificationAuthn
2526

src/idpyoidc/client/configure.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from idpyoidc.configure import Base
99
from idpyoidc.logging import configure_logging
10+
1011
from .util import lower_or_upper
1112

1213
try:

src/idpyoidc/client/entity.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ def __init__(
141141
keyjar=self.keyjar,
142142
upstream_get=self.unit_get,
143143
client_type=client_type,
144+
entity_id=self.entity_id,
144145
)
145146

146147
self.setup_client_authn_methods(config)

src/idpyoidc/client/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
from http.cookies import CookieError
55
from http.cookies import SimpleCookie
66

7-
from requests import request
87
from idpyoidc.client.exception import NonFatalException
98
from idpyoidc.client.util import sanitize
109
from idpyoidc.client.util import set_cookie
10+
from requests import request
1111

1212
__author__ = "roland"
1313

0 commit comments

Comments
 (0)