oauth2fast-fastapi 0.2.2__tar.gz → 0.2.3__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.
Files changed (44) hide show
  1. {oauth2fast_fastapi-0.2.2/src/oauth2fast_fastapi.egg-info → oauth2fast_fastapi-0.2.3}/PKG-INFO +1 -7
  2. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/pyproject.toml +10 -3
  3. oauth2fast_fastapi-0.2.3/src/oauth2fast_fastapi/__version__.py +1 -0
  4. oauth2fast_fastapi-0.2.3/src/oauth2fast_fastapi/models/bases.py +18 -0
  5. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/models/mixins.py +24 -1
  6. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/models/user_model.py +1 -8
  7. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3/src/oauth2fast_fastapi.egg-info}/PKG-INFO +1 -7
  8. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi.egg-info/requires.txt +0 -7
  9. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/tests/test_integration.py +3 -2
  10. oauth2fast_fastapi-0.2.2/src/oauth2fast_fastapi/__version__.py +0 -1
  11. oauth2fast_fastapi-0.2.2/src/oauth2fast_fastapi/models/bases.py +0 -10
  12. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/LICENSE +0 -0
  13. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/MANIFEST.in +0 -0
  14. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/README.md +0 -0
  15. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/docs/env.example +0 -0
  16. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/docs/usage.md +0 -0
  17. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/examples/basic_usage.py +0 -0
  18. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/examples/complete_flow.py +0 -0
  19. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/examples/custom_user.py +0 -0
  20. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/setup.cfg +0 -0
  21. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/__init__.py +0 -0
  22. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/database.py +0 -0
  23. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/dependencies.py +0 -0
  24. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/mail/__init__.py +0 -0
  25. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/mail/service.py +0 -0
  26. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/mail/templates/verification.html +0 -0
  27. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/mail/templates/welcome.html +0 -0
  28. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/models/__init__.py +0 -0
  29. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/routers/__init__.py +0 -0
  30. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/routers/base_router.py +0 -0
  31. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/routers/users_router.py +0 -0
  32. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/schemas/__init__.py +0 -0
  33. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/schemas/mixins.py +0 -0
  34. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/schemas/token_schema.py +0 -0
  35. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/schemas/user_schema.py +0 -0
  36. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/schemas/verification_schema.py +0 -0
  37. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/settings.py +0 -0
  38. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/utils/__init__.py +0 -0
  39. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/utils/password_utils.py +0 -0
  40. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/utils/token_utils.py +0 -0
  41. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi/utils/verification_utils.py +0 -0
  42. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi.egg-info/SOURCES.txt +0 -0
  43. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi.egg-info/dependency_links.txt +0 -0
  44. {oauth2fast_fastapi-0.2.2 → oauth2fast_fastapi-0.2.3}/src/oauth2fast_fastapi.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oauth2fast-fastapi
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Fast and secure OAuth2 authentication module for FastAPI with email verification
5
5
  Author-email: Angel Daniel Sanchez Castillo <angeldaniel.sanchezcastillo@gmail.com>
6
6
  License: MIT License
@@ -51,12 +51,6 @@ Requires-Dist: argon2-cffi>=25.0.0
51
51
  Requires-Dist: python-multipart>=0.0.6
52
52
  Requires-Dist: log2fast-fastapi>=0.1.0
53
53
  Requires-Dist: sqlmodel>=0.0.16
54
- Provides-Extra: dev
55
- Requires-Dist: pytest>=7.0.0; extra == "dev"
56
- Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
57
- Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
58
- Requires-Dist: httpx>=0.24.0; extra == "dev"
59
- Requires-Dist: mypy>=1.0.0; extra == "dev"
60
54
  Dynamic: license-file
61
55
 
62
56
  # oauth2fast-fastapi
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "oauth2fast-fastapi"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "Fast and secure OAuth2 authentication module for FastAPI with email verification"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -42,13 +42,20 @@ dependencies = [
42
42
  "sqlmodel>=0.0.16",
43
43
  ]
44
44
 
45
- [project.optional-dependencies]
45
+ [dependency-groups]
46
46
  dev = [
47
+ "black",
48
+ "ruff",
49
+ "mypy>=1.0.0",
50
+ "pre-commit",
51
+ "build",
52
+ "twine",
53
+ ]
54
+ test = [
47
55
  "pytest>=7.0.0",
48
56
  "pytest-asyncio>=0.21.0",
49
57
  "pytest-cov>=4.0.0",
50
58
  "httpx>=0.24.0",
51
- "mypy>=1.0.0",
52
59
  ]
53
60
 
54
61
  [project.urls]
@@ -0,0 +1 @@
1
+ __version__ = "0.2.3"
@@ -0,0 +1,18 @@
1
+ from sqlmodel import MetaData, SQLModel
2
+
3
+ from .mixins import IdMixin, TimestampMixin
4
+
5
+ metadata = MetaData()
6
+
7
+
8
+ class BasicAuthModel(TimestampMixin, SQLModel):
9
+ """Base model without predefined primary key, but with timestamps."""
10
+
11
+ __abstract__ = True
12
+ metadata = metadata
13
+
14
+
15
+ class AuthModel(IdMixin, BasicAuthModel):
16
+ """Default base model with BigInteger primary key and timestamps."""
17
+
18
+ __abstract__ = True
@@ -1,7 +1,15 @@
1
1
  from datetime import UTC, datetime
2
2
 
3
3
  from sqlalchemy import DateTime, func
4
- from sqlmodel import Column
4
+ from sqlmodel import BigInteger, Column, Field
5
+
6
+
7
+ class IdMixin:
8
+ """Mixin para proveer clave primaria autoincremental tipo BigInteger."""
9
+
10
+ id: int = Field(
11
+ default=None, sa_column=Column(BigInteger, index=True, primary_key=True)
12
+ )
5
13
 
6
14
 
7
15
  class TimestampMixin:
@@ -20,6 +28,21 @@ class TimestampMixin:
20
28
  )
21
29
 
22
30
 
31
+ class AuditMixin:
32
+ """Mixin para rastrear el usuario que crea y actualiza un registro."""
33
+
34
+ created_by: int | None = Field(
35
+ default=None,
36
+ description="ID of the user who created this record.",
37
+ sa_column=Column(BigInteger),
38
+ )
39
+ updated_by: int | None = Field(
40
+ default=None,
41
+ description="ID of the user who last updated this record.",
42
+ sa_column=Column(BigInteger),
43
+ )
44
+
45
+
23
46
  # class Example(TimestampMixin, SQLModel, table=True):
24
47
  # """Ejemplo de modelo con timestamps automáticos."""
25
48
  # id: int | None = Field(default=None, primary_key=True)
@@ -1,8 +1,4 @@
1
- from sqlmodel import (
2
- BigInteger,
3
- Column,
4
- Field,
5
- )
1
+ from sqlmodel import Field
6
2
 
7
3
  from .bases import AuthModel
8
4
 
@@ -12,9 +8,6 @@ from .bases import AuthModel
12
8
  class User(AuthModel, table=True):
13
9
  __tablename__ = "users"
14
10
 
15
- id: int = Field(
16
- default=None, sa_column=Column(BigInteger, index=True, primary_key=True)
17
- )
18
11
  name: str = Field(index=True)
19
12
  email: str = Field(index=True, unique=True)
20
13
  password: str = Field()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oauth2fast-fastapi
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Fast and secure OAuth2 authentication module for FastAPI with email verification
5
5
  Author-email: Angel Daniel Sanchez Castillo <angeldaniel.sanchezcastillo@gmail.com>
6
6
  License: MIT License
@@ -51,12 +51,6 @@ Requires-Dist: argon2-cffi>=25.0.0
51
51
  Requires-Dist: python-multipart>=0.0.6
52
52
  Requires-Dist: log2fast-fastapi>=0.1.0
53
53
  Requires-Dist: sqlmodel>=0.0.16
54
- Provides-Extra: dev
55
- Requires-Dist: pytest>=7.0.0; extra == "dev"
56
- Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
57
- Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
58
- Requires-Dist: httpx>=0.24.0; extra == "dev"
59
- Requires-Dist: mypy>=1.0.0; extra == "dev"
60
54
  Dynamic: license-file
61
55
 
62
56
  # oauth2fast-fastapi
@@ -6,10 +6,3 @@ argon2-cffi>=25.0.0
6
6
  python-multipart>=0.0.6
7
7
  log2fast-fastapi>=0.1.0
8
8
  sqlmodel>=0.0.16
9
-
10
- [dev]
11
- pytest>=7.0.0
12
- pytest-asyncio>=0.21.0
13
- pytest-cov>=4.0.0
14
- httpx>=0.24.0
15
- mypy>=1.0.0
@@ -60,9 +60,10 @@ async def setup_database():
60
60
 
61
61
  yield
62
62
 
63
- # Cleanup: Drop tables
63
+ # Cleanup: Drop tables with CASCADE to handle dependent tables created by tests
64
64
  async with engine.begin() as conn:
65
- await conn.run_sync(AuthModel.metadata.drop_all)
65
+ for table in reversed(AuthModel.metadata.sorted_tables):
66
+ await conn.execute(pytest.importorskip("sqlalchemy").text(f"DROP TABLE IF EXISTS {table.name} CASCADE"))
66
67
 
67
68
  # Shutdown database connections
68
69
  await shutdown_database()
@@ -1 +0,0 @@
1
- __version__ = "0.2.2"
@@ -1,10 +0,0 @@
1
- from sqlmodel import MetaData, SQLModel
2
-
3
- from .mixins import TimestampMixin
4
-
5
- metadata = MetaData()
6
-
7
-
8
- class AuthModel(TimestampMixin, SQLModel):
9
- __abstract__ = True
10
- metadata = metadata