maquinaweb-shared-auth 0.2.41__tar.gz → 0.2.43__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.
Potentially problematic release.
This version of maquinaweb-shared-auth might be problematic. Click here for more details.
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/PKG-INFO +1 -1
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/maquinaweb_shared_auth.egg-info/PKG-INFO +1 -1
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/pyproject.toml +1 -1
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/middleware.py +6 -3
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/mixins.py +8 -2
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/README.md +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/maquinaweb_shared_auth.egg-info/SOURCES.txt +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/maquinaweb_shared_auth.egg-info/dependency_links.txt +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/maquinaweb_shared_auth.egg-info/requires.txt +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/maquinaweb_shared_auth.egg-info/top_level.txt +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/setup.cfg +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/setup.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/__init__.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/abstract_models.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/app.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/authentication.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/conf.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/decorators.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/exceptions.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/fields.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/managers.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/models.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/permissions.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/router.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/serializers.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/storage_backend.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/urls.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/utils.py +0 -0
- {maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/views.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "maquinaweb-shared-auth"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.43"
|
|
8
8
|
description = "Models read-only para autenticação compartilhada entre projetos Django."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.13"
|
|
@@ -68,8 +68,9 @@ class SharedAuthMiddleware(MiddlewareMixin):
|
|
|
68
68
|
return None
|
|
69
69
|
|
|
70
70
|
# Adicionar ao request
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
if user:
|
|
72
|
+
request.user = user
|
|
73
|
+
request.auth = token_obj
|
|
73
74
|
|
|
74
75
|
except (Token.DoesNotExist, User.DoesNotExist):
|
|
75
76
|
# request.user = None
|
|
@@ -220,7 +221,9 @@ class OrganizationMiddleware(MiddlewareMixin):
|
|
|
220
221
|
Member = get_member_model()
|
|
221
222
|
member = Member.objects.filter(user_id=request.user.pk)
|
|
222
223
|
|
|
223
|
-
return
|
|
224
|
+
return (
|
|
225
|
+
list(member.values_list("organization_id", flat=True)) if member else None
|
|
226
|
+
)
|
|
224
227
|
|
|
225
228
|
@staticmethod
|
|
226
229
|
def _validate_organization_membership(user, organization_id):
|
|
@@ -28,7 +28,10 @@ class OrganizationMixin(models.Model):
|
|
|
28
28
|
"""
|
|
29
29
|
|
|
30
30
|
organization_id = models.IntegerField(
|
|
31
|
-
db_index=True,
|
|
31
|
+
db_index=True,
|
|
32
|
+
help_text="ID da organização no sistema de autenticação",
|
|
33
|
+
null=True,
|
|
34
|
+
default=None,
|
|
32
35
|
)
|
|
33
36
|
objects = BaseAuthManager()
|
|
34
37
|
|
|
@@ -109,7 +112,10 @@ class UserMixin(models.Model):
|
|
|
109
112
|
"""
|
|
110
113
|
|
|
111
114
|
user_id = models.IntegerField(
|
|
112
|
-
db_index=True,
|
|
115
|
+
db_index=True,
|
|
116
|
+
help_text="ID do usuário no sistema de autenticação",
|
|
117
|
+
null=True,
|
|
118
|
+
default=None,
|
|
113
119
|
)
|
|
114
120
|
objects = BaseAuthManager()
|
|
115
121
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/abstract_models.py
RENAMED
|
File without changes
|
|
File without changes
|
{maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/authentication.py
RENAMED
|
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
|
{maquinaweb_shared_auth-0.2.41 → maquinaweb_shared_auth-0.2.43}/shared_auth/storage_backend.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|