dj-jwt-auth 1.3.0__tar.gz → 1.3.1__tar.gz
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.
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/PKG-INFO +4 -2
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/README.md +3 -1
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/dj_jwt_auth.egg-info/PKG-INFO +4 -2
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/dj_jwt_auth.egg-info/SOURCES.txt +1 -0
- dj-jwt-auth-1.3.1/django_jwt/roles.py +3 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/django_jwt/settings.py +1 -2
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/django_jwt/user.py +0 -2
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/setup.cfg +1 -1
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/tests/test.py +2 -1
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/dj_jwt_auth.egg-info/dependency_links.txt +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/dj_jwt_auth.egg-info/requires.txt +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/dj_jwt_auth.egg-info/top_level.txt +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/django_jwt/__init__.py +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/django_jwt/config.py +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/django_jwt/exceptions.py +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/django_jwt/middleware.py +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/django_jwt/pkce.py +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/django_jwt/urls.py +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/django_jwt/utils.py +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/django_jwt/views.py +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/pyproject.toml +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/setup.py +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/tests/__init__.py +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/tests/models.py +0 -0
- {dj-jwt-auth-1.3.0 → dj-jwt-auth-1.3.1}/tests/urls.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dj-jwt-auth
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.1
|
|
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
|
|
@@ -95,8 +95,10 @@ To integrate admin panel with OIDC, add OIDC_ADMIN_ISSUER and OIDC_ADMIN_CLIENT_
|
|
|
95
95
|
```
|
|
96
96
|
- OIDC_ADMIN_CLIENT_ID - by default "complete-anatomy"
|
|
97
97
|
To mapping roles to admin panel permissions, use OIDC_ADMIN_ROLES. Example:
|
|
98
|
+
|
|
98
99
|
```python
|
|
99
|
-
|
|
100
|
+
|
|
101
|
+
from django_jwt.roles import ROLE
|
|
100
102
|
|
|
101
103
|
OIDC_ADMIN_ROLES = [
|
|
102
104
|
ROLE(
|
|
@@ -71,8 +71,10 @@ To integrate admin panel with OIDC, add OIDC_ADMIN_ISSUER and OIDC_ADMIN_CLIENT_
|
|
|
71
71
|
```
|
|
72
72
|
- OIDC_ADMIN_CLIENT_ID - by default "complete-anatomy"
|
|
73
73
|
To mapping roles to admin panel permissions, use OIDC_ADMIN_ROLES. Example:
|
|
74
|
+
|
|
74
75
|
```python
|
|
75
|
-
|
|
76
|
+
|
|
77
|
+
from django_jwt.roles import ROLE
|
|
76
78
|
|
|
77
79
|
OIDC_ADMIN_ROLES = [
|
|
78
80
|
ROLE(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dj-jwt-auth
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.1
|
|
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
|
|
@@ -95,8 +95,10 @@ To integrate admin panel with OIDC, add OIDC_ADMIN_ISSUER and OIDC_ADMIN_CLIENT_
|
|
|
95
95
|
```
|
|
96
96
|
- OIDC_ADMIN_CLIENT_ID - by default "complete-anatomy"
|
|
97
97
|
To mapping roles to admin panel permissions, use OIDC_ADMIN_ROLES. Example:
|
|
98
|
+
|
|
98
99
|
```python
|
|
99
|
-
|
|
100
|
+
|
|
101
|
+
from django_jwt.roles import ROLE
|
|
100
102
|
|
|
101
103
|
OIDC_ADMIN_ROLES = [
|
|
102
104
|
ROLE(
|
|
@@ -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)
|
|
@@ -42,6 +43,4 @@ 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)}"
|
|
@@ -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:
|
|
@@ -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
|
|
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",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|