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

Commit 5f828cf

Browse files
authored
Merge pull request #1 from IdentityPython/master
merge
2 parents 5b654d0 + abaa13e commit 5f828cf

57 files changed

Lines changed: 4378 additions & 3645 deletions

Some content is hidden

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

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,14 @@ def run_tests(self):
5656
classifiers=[
5757
"Development Status :: 4 - Beta",
5858
"License :: OSI Approved :: Apache Software License",
59-
"Programming Language :: Python :: 3.4",
60-
"Programming Language :: Python :: 3.5",
6159
"Programming Language :: Python :: 3.6",
60+
"Programming Language :: Python :: 3.7",
61+
"Programming Language :: Python :: 3.8",
6262
"Topic :: Software Development :: Libraries :: Python Modules"],
63+
extras_require={
64+
'docs': ['Sphinx', 'sphinx-autobuild', 'alabaster'],
65+
'quality': ['pylama', 'isort', 'eradicate', 'mypy', 'black', 'bandit'],
66+
},
6367
install_requires=[
6468
"oidcmsg>=0.6.3",
6569
"oidcservice>=0.6.3",

src/oidcendpoint/__init__.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
import string
2+
23
# Since SystemRandom is not available on all systems
34
try:
45
import random.SystemRandom as rnd
56
except ImportError:
67
import random as rnd
78

8-
__version__ = '0.8.5'
9+
__version__ = "0.9.0"
910

1011

11-
DEF_SIGN_ALG = {"id_token": "RS256",
12-
"userinfo": "RS256",
13-
"request_object": "RS256",
14-
"client_secret_jwt": "HS256",
15-
"private_key_jwt": "RS256"}
12+
DEF_SIGN_ALG = {
13+
"id_token": "RS256",
14+
"userinfo": "RS256",
15+
"request_object": "RS256",
16+
"client_secret_jwt": "HS256",
17+
"private_key_jwt": "RS256",
18+
}
1619

1720
HTTP_ARGS = ["headers", "redirections", "connection_type"]
1821

1922
JWT_BEARER = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
2023

21-
URL_ENCODED = 'application/x-www-form-urlencoded'
24+
URL_ENCODED = "application/x-www-form-urlencoded"
2225
JSON_ENCODED = "application/json"
2326
JOSE_ENCODED = "application/jose"
2427

src/oidcendpoint/authn_event.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66

77
class AuthnEvent(Message):
88
c_param = {
9-
'uid': SINGLE_REQUIRED_STRING,
10-
'salt': SINGLE_REQUIRED_STRING,
11-
'authn_info': SINGLE_REQUIRED_STRING,
12-
'authn_time': SINGLE_OPTIONAL_INT,
13-
'valid_until': SINGLE_OPTIONAL_INT
9+
"uid": SINGLE_REQUIRED_STRING,
10+
"salt": SINGLE_REQUIRED_STRING,
11+
"authn_info": SINGLE_REQUIRED_STRING,
12+
"authn_time": SINGLE_OPTIONAL_INT,
13+
"valid_until": SINGLE_OPTIONAL_INT,
1414
}
1515

1616
def valid(self, now=0):
1717
if now:
18-
return self['valid_until'] > now
18+
return self["valid_until"] > now
1919
else:
20-
return self['valid_until'] > time_sans_frac()
20+
return self["valid_until"] > time_sans_frac()
2121

2222
def expires_in(self):
23-
return self['valid_until'] - time_sans_frac()
23+
return self["valid_until"] - time_sans_frac()
2424

2525

2626
def create_authn_event(uid, salt, authn_info=None, **kwargs):
@@ -33,22 +33,22 @@ def create_authn_event(uid, salt, authn_info=None, **kwargs):
3333
:return:
3434
"""
3535

36-
args = {'uid': uid, 'salt': salt, 'authn_info': authn_info}
36+
args = {"uid": uid, "salt": salt, "authn_info": authn_info}
3737

3838
try:
39-
args['authn_time'] = int(kwargs['authn_time'])
39+
args["authn_time"] = int(kwargs["authn_time"])
4040
except KeyError:
4141
try:
42-
args['authn_time'] = int(kwargs['timestamp'])
42+
args["authn_time"] = int(kwargs["timestamp"])
4343
except KeyError:
44-
args['authn_time'] = time_sans_frac()
44+
args["authn_time"] = time_sans_frac()
4545

4646
try:
47-
args['valid_until'] = kwargs['valid_until']
47+
args["valid_until"] = kwargs["valid_until"]
4848
except KeyError:
4949
try:
50-
args['valid_until'] = args['authn_time'] + kwargs['expires_in']
50+
args["valid_until"] = args["authn_time"] + kwargs["expires_in"]
5151
except KeyError:
52-
args['valid_until'] = args['authn_time'] + 3600
52+
args["valid_until"] = args["authn_time"] + 3600
5353

5454
return AuthnEvent(**args)

src/oidcendpoint/authz/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def set(self, uid, client_id, permission):
2424
try:
2525
self.permdb[uid][client_id] = permission
2626
except KeyError:
27-
self.permdb[uid] = {client_id:permission}
27+
self.permdb[uid] = {client_id: permission}
2828

2929
def permissions(self, cookie=None, **kwargs):
3030
if cookie is None:
@@ -39,7 +39,7 @@ def permissions(self, cookie=None, **kwargs):
3939
b64, _ts, typ = val
4040

4141
info = cookie_value(b64)
42-
return self.get(info['sub'], info['client_id'])
42+
return self.get(info["sub"], info["client_id"])
4343

4444
def get(self, uid, client_id):
4545
try:

0 commit comments

Comments
 (0)