maquinaweb-shared-auth 0.2.23__tar.gz → 0.2.25__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.23 → maquinaweb_shared_auth-0.2.25}/PKG-INFO +2 -1
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/maquinaweb_shared_auth.egg-info/PKG-INFO +2 -1
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/maquinaweb_shared_auth.egg-info/SOURCES.txt +1 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/maquinaweb_shared_auth.egg-info/requires.txt +1 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/pyproject.toml +7 -2
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/conf.py +3 -1
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/models.py +10 -1
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/serializers.py +5 -6
- maquinaweb_shared_auth-0.2.25/shared_auth/storage_backend.py +6 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/README.md +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/maquinaweb_shared_auth.egg-info/dependency_links.txt +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/maquinaweb_shared_auth.egg-info/top_level.txt +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/setup.cfg +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/setup.py +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/__init__.py +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/app.py +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/authentication.py +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/decorators.py +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/exceptions.py +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/fields.py +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/managers.py +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/middleware.py +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/mixins.py +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/permissions.py +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/router.py +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/urls.py +0 -0
- {maquinaweb_shared_auth-0.2.23 → maquinaweb_shared_auth-0.2.25}/shared_auth/views.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maquinaweb-shared-auth
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.25
|
|
4
4
|
Summary: Models read-only para autenticação compartilhada entre projetos Django.
|
|
5
5
|
Author-email: Seu Nome <seuemail@dominio.com>
|
|
6
6
|
License: MIT
|
|
@@ -15,6 +15,7 @@ Classifier: Operating System :: OS Independent
|
|
|
15
15
|
Requires-Python: >=3.8
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
Requires-Dist: django>=5
|
|
18
|
+
Requires-Dist: django-storages>=1.14.6
|
|
18
19
|
Requires-Dist: djangorestframework>=3
|
|
19
20
|
Requires-Dist: setuptools>=70
|
|
20
21
|
Dynamic: requires-python
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maquinaweb-shared-auth
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.25
|
|
4
4
|
Summary: Models read-only para autenticação compartilhada entre projetos Django.
|
|
5
5
|
Author-email: Seu Nome <seuemail@dominio.com>
|
|
6
6
|
License: MIT
|
|
@@ -15,6 +15,7 @@ Classifier: Operating System :: OS Independent
|
|
|
15
15
|
Requires-Python: >=3.8
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
Requires-Dist: django>=5
|
|
18
|
+
Requires-Dist: django-storages>=1.14.6
|
|
18
19
|
Requires-Dist: djangorestframework>=3
|
|
19
20
|
Requires-Dist: setuptools>=70
|
|
20
21
|
Dynamic: requires-python
|
|
@@ -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.25"
|
|
8
8
|
description = "Models read-only para autenticação compartilhada entre projetos Django."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.13"
|
|
@@ -18,7 +18,12 @@ classifiers = [
|
|
|
18
18
|
"Operating System :: OS Independent",
|
|
19
19
|
]
|
|
20
20
|
|
|
21
|
-
dependencies = [
|
|
21
|
+
dependencies = [
|
|
22
|
+
"django>=5",
|
|
23
|
+
"django-storages>=1.14.6",
|
|
24
|
+
"djangorestframework>=3",
|
|
25
|
+
"setuptools>=70",
|
|
26
|
+
]
|
|
22
27
|
|
|
23
28
|
[project.urls]
|
|
24
29
|
Homepage = "https://github.com/maquinaweb/maquinaweb-shared-auth"
|
|
@@ -8,4 +8,6 @@ def get_setting(name, default):
|
|
|
8
8
|
ORGANIZATION_TABLE = get_setting("SHARED_AUTH_ORGANIZATION_TABLE", "organization_organization")
|
|
9
9
|
USER_TABLE = get_setting("SHARED_AUTH_USER_TABLE", "auth_user")
|
|
10
10
|
MEMBER_TABLE = get_setting("SHARED_AUTH_MEMBER_TABLE", "organization_member")
|
|
11
|
-
TOKEN_TABLE = get_setting("SHARED_AUTH_TOKEN_TABLE", "organization_multitoken")
|
|
11
|
+
TOKEN_TABLE = get_setting("SHARED_AUTH_TOKEN_TABLE", "organization_multitoken")
|
|
12
|
+
CLOUDFRONT_DOMAIN = get_setting("CLOUDFRONT_DOMAIN", "")
|
|
13
|
+
CUSTOM_DOMAIN_AUTH = get_setting("CUSTOM_DOMAIN_AUTH", CLOUDFRONT_DOMAIN)
|
|
@@ -7,6 +7,7 @@ from django.contrib.auth.models import AbstractUser
|
|
|
7
7
|
from django.db import models
|
|
8
8
|
from .exceptions import OrganizationNotFoundError
|
|
9
9
|
from .conf import MEMBER_TABLE, ORGANIZATION_TABLE, USER_TABLE, TOKEN_TABLE
|
|
10
|
+
from .storage_backend import Storage
|
|
10
11
|
from .managers import (
|
|
11
12
|
SharedMemberManager,
|
|
12
13
|
SharedOrganizationManager,
|
|
@@ -45,6 +46,13 @@ class SharedToken(models.Model):
|
|
|
45
46
|
# Implementar lógica de expiração se necessário
|
|
46
47
|
return True
|
|
47
48
|
|
|
49
|
+
def organization_image_path(instance, filename):
|
|
50
|
+
return os.path.join(
|
|
51
|
+
"organization",
|
|
52
|
+
str(instance.pk),
|
|
53
|
+
"images",
|
|
54
|
+
filename,
|
|
55
|
+
)
|
|
48
56
|
|
|
49
57
|
class SharedOrganization(models.Model):
|
|
50
58
|
"""
|
|
@@ -59,6 +67,7 @@ class SharedOrganization(models.Model):
|
|
|
59
67
|
telephone = models.CharField(max_length=50, blank=True, null=True)
|
|
60
68
|
cellphone = models.CharField(max_length=50, blank=True, null=True)
|
|
61
69
|
email = models.EmailField(blank=True, null=True)
|
|
70
|
+
image_organization = models.ImageField(storage=Storage,upload_to=organization_image_path, null=True)
|
|
62
71
|
|
|
63
72
|
# Relacionamentos
|
|
64
73
|
main_organization_id = models.IntegerField(null=True, blank=True)
|
|
@@ -137,7 +146,7 @@ class User(AbstractUser):
|
|
|
137
146
|
|
|
138
147
|
date_joined = models.DateTimeField()
|
|
139
148
|
last_login = models.DateTimeField(null=True, blank=True)
|
|
140
|
-
|
|
149
|
+
avatar = models.ImageField(storage=Storage,blank=True, null=True)
|
|
141
150
|
# Campos customizados
|
|
142
151
|
createdat = models.DateTimeField()
|
|
143
152
|
updatedat = models.DateTimeField()
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Serializers compartilhados para DRF
|
|
3
3
|
"""
|
|
4
|
-
from rest_framework import serializers
|
|
5
4
|
from .models import SharedOrganization, User
|
|
5
|
+
from rest_framework import serializers
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
class OrganizationSerializerMixin:
|
|
7
|
+
class OrganizationSerializerMixin(serializers.ModelSerializer):
|
|
9
8
|
"""
|
|
10
9
|
Mixin para serializers que incluem dados de organização como objeto aninhado
|
|
11
10
|
|
|
@@ -71,7 +70,7 @@ class UserSerializer(serializers.ModelSerializer):
|
|
|
71
70
|
"last_login",
|
|
72
71
|
]
|
|
73
72
|
|
|
74
|
-
class UserSerializerMixin:
|
|
73
|
+
class UserSerializerMixin(serializers.ModelSerializer):
|
|
75
74
|
"""
|
|
76
75
|
Mixin para serializers que incluem dados de usuário como objeto aninhado
|
|
77
76
|
|
|
@@ -145,7 +144,7 @@ class OrganizationUserSerializerMixin(OrganizationSerializerMixin, UserSerialize
|
|
|
145
144
|
|
|
146
145
|
|
|
147
146
|
# Versões simplificadas (opcional)
|
|
148
|
-
class OrganizationSimpleSerializerMixin:
|
|
147
|
+
class OrganizationSimpleSerializerMixin(serializers.ModelSerializer):
|
|
149
148
|
"""
|
|
150
149
|
Versão simplificada que retorna apenas campos essenciais da organização
|
|
151
150
|
"""
|
|
@@ -164,7 +163,7 @@ class OrganizationSimpleSerializerMixin:
|
|
|
164
163
|
return None
|
|
165
164
|
|
|
166
165
|
|
|
167
|
-
class UserSimpleSerializerMixin:
|
|
166
|
+
class UserSimpleSerializerMixin(serializers.ModelSerializer):
|
|
168
167
|
"""
|
|
169
168
|
Versão simplificada que retorna apenas campos essenciais do usuário
|
|
170
169
|
"""
|
|
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.23 → maquinaweb_shared_auth-0.2.25}/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
|
|
File without changes
|