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

Commit 9997f59

Browse files
committed
Fixed fetch_distributed_claims.
Updated to work with cryptojwt=0.4.4, oidcmsg=0.6.1 and oidcservice=0.5.13
2 parents 61d5641 + 9e3964d commit 9997f59

2 files changed

Lines changed: 6 additions & 28 deletions

File tree

chrp/rp.py

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import cherrypy
99

10-
from oidcmsg.key_jar import build_keyjar
10+
from oidcmsg.key_jar import build_keyjar, init_key_jar
1111
from oidcmsg.key_jar import KeyJar
1212

1313
from oidcrp import RPHandler
@@ -25,29 +25,6 @@
2525
SIGKEY_NAME = 'sigkey.jwks'
2626

2727

28-
def get_jwks(private_path, keydefs, public_path):
29-
if os.path.isfile(private_path):
30-
_jwks = open(private_path, 'r').read()
31-
_kj = KeyJar()
32-
_kj.import_jwks(json.loads(_jwks), '')
33-
else:
34-
_kj = build_keyjar(keydefs)[1]
35-
jwks = _kj.export_jwks(private=True)
36-
head, tail = os.path.split(private_path)
37-
if not os.path.isdir(head):
38-
os.makedirs(head)
39-
fp = open(private_path, 'w')
40-
fp.write(json.dumps(jwks))
41-
fp.close()
42-
43-
jwks = _kj.export_jwks() # public part
44-
fp = open(public_path, 'w')
45-
fp.write(json.dumps(jwks))
46-
fp.close()
47-
48-
return _kj
49-
50-
5128
if __name__ == '__main__':
5229
import argparse
5330

@@ -103,8 +80,9 @@ def get_jwks(private_path, keydefs, public_path):
10380

10481
_base_url = config.BASEURL
10582

106-
_kj = get_jwks(config.PRIVATE_JWKS_PATH, config.KEYDEFS,
107-
config.PUBLIC_JWKS_PATH)
83+
_kj = init_key_jar(public_path=config.PUBLIC_JWKS_PATH,
84+
private_path=config.PRIVATE_JWKS_PATH,
85+
key_defs=config.KEYDEFS)
10886

10987
if args.insecure:
11088
_kj.verify_ssl = False

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def run_tests(self):
6565
"Topic :: Software Development :: Libraries :: Python Modules"],
6666
install_requires=[
6767
'cryptojwt>=0.3.1',
68-
'oidcservice>=0.5.10',
69-
'oidcmsg>=0.3.5'
68+
'oidcservice>=0.5.12',
69+
'oidcmsg>=0.5.0'
7070
],
7171
tests_require=[
7272
'pytest',

0 commit comments

Comments
 (0)