dj-jwt-auth 1.5.4__py3-none-any.whl → 1.5.6__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.5.4
3
+ Version: 1.5.6
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
@@ -4,17 +4,18 @@ 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
6
  django_jwt/roles.py,sha256=SaHK3o8T8USS4ZhG4SrHPlZQV2lMb2t1UZHT6IQtBvA,143
7
- django_jwt/settings.py,sha256=gJePa3ER0vY6k5sDk-L1VagjbF4_dYrP0zrRJkGNY6Y,1708
7
+ django_jwt/settings.py,sha256=4mc8daSDKs3uYlRJBuS4CP7_CtKD3VrLWvaBjJ6yJV8,1837
8
8
  django_jwt/urls.py,sha256=ZhcnRcQ1MBRh-bS7fTa-Vkz8yuWUhv-G_uRXKLnKAs0,320
9
9
  django_jwt/user.py,sha256=lQ7AIdI4J-d2e1oCQIIyQKnXtjqCYD14e4WOhF2LbYs,5292
10
10
  django_jwt/utils.py,sha256=Gz8cH0cD3y_cvW8FwRoCFgShBrYvcB7XBF0GWx0n2qQ,1485
11
- django_jwt/views.py,sha256=LweS9G_NBeiuVDLhtm_GtOi_Ok6Sz5KJVTU62k91Jcg,4352
12
- django_jwt/templates/django-jwt-index.html,sha256=8ud1y8gBeUlAFO4qcSjvmGm_TrexR9z8AoGUQJgfHE4,1089
11
+ django_jwt/views.py,sha256=MDuMPzmEAjWR6lB8ZyiozAJYH49MaiYeztE1we_u-9M,4352
12
+ django_jwt/templates/django-jwt-index.html,sha256=y8f0v2WbRAFxnIU799I_MZCVsjn1sbdh7bypjdWB0lA,1353
13
+ django_jwt/templates/admin/login.html,sha256=Nihyu0IGvDDZVvQDITXozwlj6XCQ0B8gqlyHLqVNyJc,275
13
14
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
15
  tests/models.py,sha256=4uonwXuAvJGlITpuxFazyoeA_CSUYMyN7Vj1gEWJTH4,308
15
16
  tests/test.py,sha256=nD1sm_nH0l9ADnwavySPdhgrNOvLX7nLYol7w306TFU,9720
16
17
  tests/urls.py,sha256=D5FhDSVAudurkrpkCZZPnDvgXSgifwFVB3nAlYBg7uQ,212
17
- dj_jwt_auth-1.5.4.dist-info/METADATA,sha256=VtJfpoaWWgp7k9lRxhzPOMy5NhOq2jzN5vXKl5skJkA,4369
18
- dj_jwt_auth-1.5.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
19
- dj_jwt_auth-1.5.4.dist-info/top_level.txt,sha256=58O7TdK-yECZcbmPc52KNlBFpjIUlENuZubCxaSOxus,17
20
- dj_jwt_auth-1.5.4.dist-info/RECORD,,
18
+ dj_jwt_auth-1.5.6.dist-info/METADATA,sha256=jgfJxaxVrgPgzLwbR4xR7_ofMjYRosK78hmePUR0qVM,4369
19
+ dj_jwt_auth-1.5.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
20
+ dj_jwt_auth-1.5.6.dist-info/top_level.txt,sha256=58O7TdK-yECZcbmPc52KNlBFpjIUlENuZubCxaSOxus,17
21
+ dj_jwt_auth-1.5.6.dist-info/RECORD,,
django_jwt/settings.py CHANGED
@@ -42,6 +42,9 @@ OIDC_ADMIN_ISSUER = getattr(settings, "OIDC_ADMIN_ISSUER", None)
42
42
  OIDC_ADMIN_CLIENT_ID = getattr(settings, "OIDC_ADMIN_CLIENT_ID", "cs-completeanatomy-admin")
43
43
  OIDC_ADMIN_SCOPE = getattr(settings, "OIDC_ADMIN_SCOPE", "openid")
44
44
  OIDC_ADMIN_ROLES = getattr(settings, "OIDC_ADMIN_ROLES", [])
45
+ OIDC_AUTHORIZATION_BACKEND = getattr(
46
+ settings, "OIDC_AUTHORIZATION_BACKEND", "django.contrib.auth.backends.ModelBackend",
47
+ )
45
48
 
46
49
  if not OIDC_ADMIN_ISSUER:
47
50
  OIDC_ADMIN_ISSUER = OIDC_CONFIG_ROUTES.get("ES256", None)
@@ -0,0 +1,9 @@
1
+ {% extends "admin/login.html" %}
2
+
3
+ {% block content %}
4
+ {{ block.super }}
5
+ <br>
6
+ <div style="text-align: center;">
7
+ <a class="button" style="display: inline-block; margin-top: 20px" href="{% url 'start_oidc_auth' %}">NeoID Login</a>
8
+ </div>
9
+ {% endblock %}
@@ -40,6 +40,13 @@
40
40
  <div class="error-message">
41
41
  {{ error_message }}
42
42
  </div>
43
+
44
+ <hgroup>
45
+ <h3>How to receive access</h3>
46
+ <a href="https://elsevier.atlassian.net/wiki/spaces/HM3D4MED/pages/119483629076583/Admin+panels+access"
47
+ target="_blank" rel="noopener noreferrer"
48
+ >Confluence page</a>
49
+ </hgroup>
43
50
  </div>
44
51
  </body>
45
52
  </html>
django_jwt/views.py CHANGED
@@ -99,7 +99,7 @@ class ReceiveRedirectView(AbsView):
99
99
  roles = role_handler.apply(user, data)
100
100
  if not user.is_staff:
101
101
  raise BadRequestException(f"User {user.email} is not staff\nRoles: {roles}")
102
- login(request, user, backend=settings.DEFAULT_AUTHENTICATION_BACKEND)
102
+ login(request, user, backend=jwt_settings.OIDC_AUTHORIZATION_BACKEND)
103
103
  return redirect("admin:index")
104
104
 
105
105
  raise BadRequestException("No PKCE secret found in cache")