django-spire 0.23.11__py3-none-any.whl → 0.23.12__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.
- django_spire/auth/decorators.py +23 -0
- django_spire/consts.py +1 -1
- {django_spire-0.23.11.dist-info → django_spire-0.23.12.dist-info}/METADATA +1 -1
- {django_spire-0.23.11.dist-info → django_spire-0.23.12.dist-info}/RECORD +7 -6
- {django_spire-0.23.11.dist-info → django_spire-0.23.12.dist-info}/WHEEL +0 -0
- {django_spire-0.23.11.dist-info → django_spire-0.23.12.dist-info}/licenses/LICENSE.md +0 -0
- {django_spire-0.23.11.dist-info → django_spire-0.23.12.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from typing import Callable
|
|
2
|
+
|
|
3
|
+
from django.core.handlers.wsgi import WSGIRequest
|
|
4
|
+
from django.http.response import HttpResponse
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def bearer_token_auth_required(token: str) -> Callable[[Callable], Callable]:
|
|
8
|
+
def decorator_wrapper(view_func: Callable) -> Callable:
|
|
9
|
+
def view_wrapper(request: WSGIRequest, *args, **kwargs) -> HttpResponse:
|
|
10
|
+
if request.user.is_authenticated:
|
|
11
|
+
return view_func(request, *args, **kwargs)
|
|
12
|
+
|
|
13
|
+
auth_header_parts = request.META.get('HTTP_AUTHORIZATION', '').split(' ')
|
|
14
|
+
|
|
15
|
+
if auth_header_parts[0].lower() == 'bearer':
|
|
16
|
+
if auth_header_parts[1] == token:
|
|
17
|
+
return view_func(request, *args, **kwargs)
|
|
18
|
+
|
|
19
|
+
return HttpResponse(status=401)
|
|
20
|
+
|
|
21
|
+
return view_wrapper
|
|
22
|
+
|
|
23
|
+
return decorator_wrapper
|
django_spire/consts.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: django-spire
|
|
3
|
-
Version: 0.23.
|
|
3
|
+
Version: 0.23.12
|
|
4
4
|
Summary: A project for Django Spire
|
|
5
5
|
Author-email: Brayden Carlson <braydenc@stratusadv.com>, Nathan Johnson <nathanj@stratusadv.com>
|
|
6
6
|
License: Copyright (c) 2025 Stratus Advanced Technologies and Contributors.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
django_spire/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
django_spire/conf.py,sha256=3oUB1mtgHRjvbJsxfQWG5uL1KUP9uGig3zdP2dZphe8,942
|
|
3
|
-
django_spire/consts.py,sha256=
|
|
3
|
+
django_spire/consts.py,sha256=MhzlRhDnPAf20rnn0MeHHsKTpE0j66COSwpxmmMuUHg,172
|
|
4
4
|
django_spire/exceptions.py,sha256=M7buFvm-K4lK09pH5fVcZ-MxsDIzdpEJBF33Xss5bSw,289
|
|
5
5
|
django_spire/settings.py,sha256=0xImrKpF7VW4wc9jLGO07e2ev6D4-i_TREgpTepLp3I,1042
|
|
6
6
|
django_spire/urls.py,sha256=wQx6R-nXx69MeOF-WmDxcEUM5WmUHGplbY5uZ_HnDp8,703
|
|
@@ -139,6 +139,7 @@ django_spire/ai/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
|
|
|
139
139
|
django_spire/ai/tests/test_ai.py,sha256=Xjt1pWKyQCYVP47ixjEGs7fxkGoXTgRH9MFUoQc5IoQ,5404
|
|
140
140
|
django_spire/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
141
141
|
django_spire/auth/apps.py,sha256=oiRo6DHzANOojgEIyh0WTLn0_h-TUrbAegqvO8jOSRg,474
|
|
142
|
+
django_spire/auth/decorators.py,sha256=1YVr6R9NrUrz5FGz9oyCzgk4PM8FRy1vhSaM4IKoaHM,812
|
|
142
143
|
django_spire/auth/controller/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
143
144
|
django_spire/auth/controller/controller.py,sha256=_2JRhpAlLkWQEhyfCfh5w8dFoIZ9j2AudhdVUTdrWlA,2974
|
|
144
145
|
django_spire/auth/controller/exceptions.py,sha256=yxoWnl8ZGasdGjmV_ovr_VSTt0Ys6t6uiy-Ii-6yD-c,148
|
|
@@ -1369,8 +1370,8 @@ django_spire/theme/urls/page_urls.py,sha256=Oak3x_xwQEb01NKdrsB1nk6yPaOEnheuSG1m
|
|
|
1369
1370
|
django_spire/theme/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1370
1371
|
django_spire/theme/views/json_views.py,sha256=PWwVTaty0BVGbj65L5cxex6JNhc-xVAI_rEYjbJWqEM,1893
|
|
1371
1372
|
django_spire/theme/views/page_views.py,sha256=WenjOa6Welpu3IMolY56ZwBjy4aK9hpbiMNuygjAl1A,3922
|
|
1372
|
-
django_spire-0.23.
|
|
1373
|
-
django_spire-0.23.
|
|
1374
|
-
django_spire-0.23.
|
|
1375
|
-
django_spire-0.23.
|
|
1376
|
-
django_spire-0.23.
|
|
1373
|
+
django_spire-0.23.12.dist-info/licenses/LICENSE.md,sha256=ZAeCT76WvaoEZE9xPhihyWjTwH0wQZXQmyRsnV2VPFs,1091
|
|
1374
|
+
django_spire-0.23.12.dist-info/METADATA,sha256=JVyjk_PCyNHx2okQ8_yiZ9GDAI4KsNPUmJScqZWGHis,5128
|
|
1375
|
+
django_spire-0.23.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
1376
|
+
django_spire-0.23.12.dist-info/top_level.txt,sha256=xf3QV1e--ONkVpgMDQE9iqjQ1Vg4--_6C8wmO-KxPHQ,13
|
|
1377
|
+
django_spire-0.23.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|