dj-jwt-auth 1.3.0__py3-none-any.whl → 1.3.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dj-jwt-auth
3
- Version: 1.3.0
3
+ Version: 1.3.2
4
4
  Summary: A Django package for JSON Web Token validation and verification. Using PyJWT.
5
5
  Home-page: https://www.example.com/
6
6
  Author: Konstantin Seleznev
@@ -99,8 +99,10 @@ To integrate admin panel with OIDC, add OIDC_ADMIN_ISSUER and OIDC_ADMIN_CLIENT_
99
99
  ```
100
100
  - OIDC_ADMIN_CLIENT_ID - by default "complete-anatomy"
101
101
  To mapping roles to admin panel permissions, use OIDC_ADMIN_ROLES. Example:
102
+
102
103
  ```python
103
- from django_jwt.user import ROLE
104
+
105
+ from django_jwt.roles import ROLE
104
106
 
105
107
  OIDC_ADMIN_ROLES = [
106
108
  ROLE(
@@ -3,16 +3,17 @@ django_jwt/config.py,sha256=BM_JeyJRB9qms9W5jcykkAJ5Cq3JqyAgvNE6dRrXSYw,1301
3
3
  django_jwt/exceptions.py,sha256=vFJcGOCSZvxJRbSeMgWgPUM9wcXu6CSHblpwMzhV-Ic,198
4
4
  django_jwt/middleware.py,sha256=4PiF0-v13aLjvTyeyumQqYFimb6gCDHBgm6KooPGZdM,1176
5
5
  django_jwt/pkce.py,sha256=HYIQI0vKSmQkYIqTj3cciIT01ldkjhqlYiXkYcnNSGc,711
6
- django_jwt/settings.py,sha256=x8-aoc-S_xfP4n1xTfx9Um_FMNYuWOQvL7VvgIIA8ek,1478
6
+ django_jwt/roles.py,sha256=SaHK3o8T8USS4ZhG4SrHPlZQV2lMb2t1UZHT6IQtBvA,143
7
+ django_jwt/settings.py,sha256=LAGUY1lWt-SzxULj5UmZ4mU2v35hkuTpDwS9fiWsomc,1482
7
8
  django_jwt/urls.py,sha256=OoKbJ2kf41tuDBnVjK5TTW4aVt9bhRaz59HFlUOAins,251
8
- django_jwt/user.py,sha256=5k6YLLps-bvMS6_p5ql4ZKd_NJI2DnZtJ0jAJGmgltA,5163
9
+ django_jwt/user.py,sha256=_ZZdfAFdQeScMmWwkrzo-5XjTKMVCbmfK4FPpiCbaQQ,5021
9
10
  django_jwt/utils.py,sha256=Gz8cH0cD3y_cvW8FwRoCFgShBrYvcB7XBF0GWx0n2qQ,1485
10
11
  django_jwt/views.py,sha256=Mwcd70Qrp5aeZYgXWBMzkm8DD01Tf1nAVlfq6wIlhQY,3705
11
12
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
13
  tests/models.py,sha256=K5e0QCgyZeLLHS6i3KRMQHooql47g7qqni7f9tKQrIY,251
13
- tests/test.py,sha256=tBtYp-DaExWflj2G55_vrG_8BnqQgeUad15VJupvLlk,7432
14
+ tests/test.py,sha256=uZz9eG1nC1CljITD6K79Ruodtr8SDPEnBSt_5GOLVSc,7460
14
15
  tests/urls.py,sha256=D5FhDSVAudurkrpkCZZPnDvgXSgifwFVB3nAlYBg7uQ,212
15
- dj_jwt_auth-1.3.0.dist-info/METADATA,sha256=5agn7q8OTUtcSJLr3MAl8cYLZoDV8CFBb4oIsLAVK34,3991
16
- dj_jwt_auth-1.3.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
17
- dj_jwt_auth-1.3.0.dist-info/top_level.txt,sha256=58O7TdK-yECZcbmPc52KNlBFpjIUlENuZubCxaSOxus,17
18
- dj_jwt_auth-1.3.0.dist-info/RECORD,,
16
+ dj_jwt_auth-1.3.2.dist-info/METADATA,sha256=vnzYe9JcRYPzscVua47fIH_4_3_wsDGNa0v1zV7U1FE,3994
17
+ dj_jwt_auth-1.3.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
18
+ dj_jwt_auth-1.3.2.dist-info/top_level.txt,sha256=58O7TdK-yECZcbmPc52KNlBFpjIUlENuZubCxaSOxus,17
19
+ dj_jwt_auth-1.3.2.dist-info/RECORD,,
django_jwt/roles.py ADDED
@@ -0,0 +1,3 @@
1
+ from collections import namedtuple
2
+
3
+ ROLE = namedtuple("Role", ["name", "is_superuser", "groups", "permissions"], defaults=["", False, [], []])
django_jwt/settings.py CHANGED
@@ -1,4 +1,5 @@
1
1
  from django.conf import settings
2
+ from django_jwt.roles import ROLE
2
3
 
3
4
  OIDC_AUDIENCE = getattr(settings, "OIDC_AUDIENCE", ["account", "broker"])
4
5
  OIDC_CONFIG_URL = getattr(settings, "OIDC_CONFIG_URL", None)
@@ -37,11 +38,9 @@ OIDC_USER_ON_UPDATE = getattr(
37
38
 
38
39
  OIDC_CONFIG_ROUTES = getattr(settings, "OIDC_CONFIG_ROUTES", None)
39
40
  OIDC_ADMIN_ISSUER = getattr(settings, "OIDC_ADMIN_ISSUER", None)
40
- OIDC_ADMIN_CLIENT_ID = getattr(settings, "OIDC_ADMIN_CLIENT_ID", "complete-anatomy")
41
+ OIDC_ADMIN_CLIENT_ID = getattr(settings, "OIDC_ADMIN_CLIENT_ID", "cs-completeanatomy-admin")
41
42
  OIDC_ADMIN_SCOPE = getattr(settings, "OIDC_ADMIN_SCOPE", "openid")
42
43
  OIDC_ADMIN_ROLES = getattr(settings, "OIDC_ADMIN_ROLES", [])
43
44
 
44
45
  for role in OIDC_ADMIN_ROLES:
45
- from django_jwt.user import ROLE
46
-
47
46
  assert isinstance(role, ROLE), f"Role must be a namedtuple, got {type(role)}"
django_jwt/user.py CHANGED
@@ -1,4 +1,3 @@
1
- from collections import namedtuple
2
1
  from datetime import datetime
3
2
  from functools import cache
4
3
  from logging import getLogger
@@ -15,7 +14,6 @@ utc = pytz.UTC
15
14
  log = getLogger(__name__)
16
15
 
17
16
  model = get_user_model()
18
- ROLE = namedtuple("Role", ["name", "is_superuser", "groups", "permissions"], defaults=["", False, [], []])
19
17
 
20
18
 
21
19
  class UserHandler:
tests/test.py CHANGED
@@ -9,7 +9,8 @@ from jwt.api_jwt import ExpiredSignatureError
9
9
 
10
10
  from django_jwt import settings
11
11
  from django_jwt.middleware import JWTAuthMiddleware
12
- from django_jwt.user import ROLE, role_handler
12
+ from django_jwt.user import role_handler
13
+ from django_jwt.roles import ROLE
13
14
 
14
15
  access_token_payload = {
15
16
  "sub": "12345",