fastapi-async-auth-kit 0.1.0__tar.gz → 0.3.0__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 (29) hide show
  1. fastapi_async_auth_kit-0.3.0/PKG-INFO +199 -0
  2. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.3.0}/README.md +5 -5
  3. fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit/__init__.py +5 -0
  4. {fastapi_async_auth_kit-0.1.0/fastapi_auth_kit → fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit}/api/auth.py +2 -2
  5. fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit/core/setup.py +14 -0
  6. {fastapi_async_auth_kit-0.1.0/fastapi_auth_kit → fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit}/db/factory.py +2 -2
  7. {fastapi_async_auth_kit-0.1.0/fastapi_auth_kit → fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit}/dependencies/auth.py +1 -1
  8. {fastapi_async_auth_kit-0.1.0/fastapi_auth_kit → fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit}/services/auth_service.py +1 -1
  9. fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit.egg-info/PKG-INFO +199 -0
  10. fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit.egg-info/SOURCES.txt +21 -0
  11. fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit.egg-info/top_level.txt +1 -0
  12. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.3.0}/pyproject.toml +5 -3
  13. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.3.0}/tests/test_auth.py +1 -1
  14. fastapi_async_auth_kit-0.1.0/PKG-INFO +0 -21
  15. fastapi_async_auth_kit-0.1.0/fastapi_async_auth_kit.egg-info/PKG-INFO +0 -21
  16. fastapi_async_auth_kit-0.1.0/fastapi_async_auth_kit.egg-info/SOURCES.txt +0 -21
  17. fastapi_async_auth_kit-0.1.0/fastapi_async_auth_kit.egg-info/top_level.txt +0 -1
  18. fastapi_async_auth_kit-0.1.0/fastapi_auth_kit/__init__.py +0 -5
  19. fastapi_async_auth_kit-0.1.0/fastapi_auth_kit/core/setup.py +0 -14
  20. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.3.0}/LICENSE +0 -0
  21. {fastapi_async_auth_kit-0.1.0/fastapi_auth_kit → fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit}/core/config.py +0 -0
  22. {fastapi_async_auth_kit-0.1.0/fastapi_auth_kit → fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit}/core/security.py +0 -0
  23. {fastapi_async_auth_kit-0.1.0/fastapi_auth_kit → fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit}/db/base.py +0 -0
  24. {fastapi_async_auth_kit-0.1.0/fastapi_auth_kit → fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit}/db/mongo_repo.py +0 -0
  25. {fastapi_async_auth_kit-0.1.0/fastapi_auth_kit → fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit}/db/sqlalchemy_repo.py +0 -0
  26. {fastapi_async_auth_kit-0.1.0/fastapi_auth_kit → fastapi_async_auth_kit-0.3.0/fastapi_async_auth_kit}/schemas/auth.py +0 -0
  27. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.3.0}/fastapi_async_auth_kit.egg-info/dependency_links.txt +0 -0
  28. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.3.0}/fastapi_async_auth_kit.egg-info/requires.txt +0 -0
  29. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.3.0}/setup.cfg +0 -0
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastapi-async-auth-kit
3
+ Version: 0.3.0
4
+ Summary: Production-ready FastAPI auth system with JWT, refresh tokens, and async DB support
5
+ Author-email: Keyurkumar <kmistry1110@gmail.com>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: fastapi
11
+ Requires-Dist: pydantic
12
+ Requires-Dist: python-jose
13
+ Requires-Dist: argon2-cffi
14
+ Requires-Dist: sqlalchemy>=2.0
15
+ Provides-Extra: postgres
16
+ Requires-Dist: asyncpg; extra == "postgres"
17
+ Provides-Extra: mysql
18
+ Requires-Dist: aiomysql; extra == "mysql"
19
+ Provides-Extra: sqlite
20
+ Requires-Dist: aiosqlite; extra == "sqlite"
21
+ Provides-Extra: mongodb
22
+ Requires-Dist: motor; extra == "mongodb"
23
+ Dynamic: license-file
24
+
25
+ # FastAPI Auth 🔐
26
+
27
+ Production-ready authentication system for FastAPI with async support, JWT, refresh tokens, and pluggable database backends.
28
+
29
+ ---
30
+
31
+ ## 🚀 Features
32
+
33
+ * ⚡ Fully async (no blocking I/O)
34
+ * 🔐 JWT authentication (access + refresh tokens)
35
+ * 🔁 Refresh token flow
36
+ * 🚪 Logout with token blacklist
37
+ * 🧱 Multi-database support:
38
+
39
+ * PostgreSQL (asyncpg)
40
+ * MySQL (aiomysql)
41
+ * SQLite (aiosqlite)
42
+ * MongoDB (motor)
43
+ * 🧠 Dependency-based auth (FastAPI native)
44
+ * 📦 Plug-and-play integration
45
+ * 🛡️ Password hashing with Argon2 (modern standard)
46
+ * 📄 Clean OpenAPI (Swagger) docs with Pydantic schemas
47
+
48
+ ---
49
+
50
+ ## 📦 Installation
51
+
52
+ ```bash
53
+ pip install "fastapi-async-auth-kit[<db>]"
54
+ ```
55
+
56
+ ### With database support
57
+
58
+ ```bash
59
+ pip install "fastapi-async-auth-kit[postgres]"
60
+ pip install "fastapi-async-auth-kit[mysql]"
61
+ pip install "fastapi-async-auth-kit[mongodb]"
62
+ pip install "fastapi-async-auth-kit[sqlite]"
63
+ ```
64
+
65
+ ---
66
+
67
+ ## ⚙️ Quick Start
68
+
69
+ ### Step 1: How to initiate auth on startup
70
+ ```python
71
+ from fastapi import FastAPI
72
+ from fastapi_auth_ import init_auth, AuthConfig
73
+
74
+ app = FastAPI()
75
+
76
+ @app.on_event("startup")
77
+ async def startup():
78
+ await init_auth(
79
+ app,
80
+ AuthConfig(
81
+ secret_key="your-secret",
82
+ db_url="postgresql+asyncpg://user:pass@localhost/db",
83
+ db_type="postgres"
84
+ )
85
+ )
86
+ ```
87
+
88
+ ### Step 2: How to validate token for all your FastAPIs
89
+ ```python
90
+ from fastapi import APIRouter, Depends
91
+ from fastapi_auth.dependencies.auth import get_current_user
92
+ router = APIRouter()
93
+
94
+ @router.get("/user")
95
+ async def me(user=Depends(get_current_user)):
96
+ return user
97
+ ```
98
+
99
+
100
+ ---
101
+
102
+ ## 🔐 Available Endpoints
103
+
104
+ | Endpoint | Description |
105
+ | ------------------- | ----------------------- |
106
+ | POST /auth/register | Register new user |
107
+ | POST /auth/login | Login and get tokens |
108
+ | POST /auth/refresh | Refresh access token |
109
+ | POST /auth/logout | Logout and revoke token |
110
+ | GET /auth/me | Get current user |
111
+
112
+ ---
113
+
114
+ ## 🧪 Example
115
+
116
+ ### Login
117
+
118
+ ```json
119
+ POST /auth/login
120
+
121
+ {
122
+ "username": "john",
123
+ "password": "Strong@123"
124
+ }
125
+ ```
126
+
127
+ ### Response
128
+
129
+ ```json
130
+ {
131
+ "access": "jwt_token",
132
+ "refresh": "refresh_token"
133
+ }
134
+ ```
135
+
136
+ ---
137
+
138
+ ## 🧠 Architecture
139
+
140
+ ```
141
+ FastAPI App
142
+
143
+ Auth Service
144
+
145
+ Repository Layer
146
+
147
+ Database (Async)
148
+ ```
149
+
150
+ ---
151
+
152
+ ## 🛡️ Security
153
+
154
+ * Argon2 password hashing
155
+ * JWT token expiration
156
+ * Refresh token blacklist
157
+ * No sensitive data exposure
158
+ * Clean error handling
159
+
160
+ ---
161
+
162
+ ## 🧩 Extensibility
163
+
164
+ * Add RBAC (roles & permissions)
165
+ * Plug custom user models
166
+ * Add OAuth providers (Google, GitHub)
167
+ * Integrate Redis for token storage
168
+
169
+ ---
170
+
171
+ ## 🛠 Tech Stack
172
+
173
+ * FastAPI
174
+ * SQLAlchemy (async)
175
+ * Pydantic
176
+ * python-jose (JWT)
177
+ * Argon2 (password hashing)
178
+
179
+ ---
180
+
181
+ ## 📌 Roadmap
182
+
183
+ * [ ] RBAC support
184
+ * [ ] Redis token blacklist
185
+ * [ ] OAuth integration
186
+ * [ ] Rate limiting
187
+ * [ ] Email verification
188
+
189
+ ---
190
+
191
+ ## 🤝 Contributing
192
+
193
+ Pull requests are welcome. For major changes, open an issue first.
194
+
195
+ ---
196
+
197
+ ## 📄 License
198
+
199
+ MIT License
@@ -26,16 +26,16 @@ Production-ready authentication system for FastAPI with async support, JWT, refr
26
26
  ## 📦 Installation
27
27
 
28
28
  ```bash
29
- pip install fastapi-auth[<db>]
29
+ pip install "fastapi-async-auth-kit[<db>]"
30
30
  ```
31
31
 
32
32
  ### With database support
33
33
 
34
34
  ```bash
35
- pip install fastapi-auth[postgres]
36
- pip install fastapi-auth[mysql]
37
- pip install fastapi-auth[mongodb]
38
- pip install fastapi-auth[sqlite]
35
+ pip install "fastapi-async-auth-kit[postgres]"
36
+ pip install "fastapi-async-auth-kit[mysql]"
37
+ pip install "fastapi-async-auth-kit[mongodb]"
38
+ pip install "fastapi-async-auth-kit[sqlite]"
39
39
  ```
40
40
 
41
41
  ---
@@ -0,0 +1,5 @@
1
+ from fastapi_async_auth_kit.core.setup import init_auth
2
+ from fastapi_async_auth_kit.core.config import AuthConfig
3
+ from fastapi_async_auth_kit.dependencies.auth import get_current_user
4
+
5
+ __all__ = ["init_auth", "AuthConfig", "get_current_user"]
@@ -1,11 +1,11 @@
1
1
  from fastapi import APIRouter, Request, Depends
2
- from fastapi_auth_kit.schemas.auth import (
2
+ from fastapi_async_auth_kit.schemas.auth import (
3
3
  RegisterRequest,
4
4
  LoginRequest,
5
5
  RefreshRequest,
6
6
  TokenResponse
7
7
  )
8
- from fastapi_auth_kit.dependencies.auth import get_current_user
8
+ from fastapi_async_auth_kit.dependencies.auth import get_current_user
9
9
 
10
10
  router = APIRouter()
11
11
 
@@ -0,0 +1,14 @@
1
+ from fastapi_async_auth_kit.db.factory import get_repo
2
+ from fastapi_async_auth_kit.services.auth_service import AuthService
3
+ from fastapi_async_auth_kit.api.auth import router
4
+ from fastapi_async_auth_kit.dependencies import auth
5
+
6
+ async def init_auth(app, config):
7
+ repo = await get_repo(config)
8
+
9
+ service = AuthService(repo, config.secret_key)
10
+
11
+ auth.SECRET = config.secret_key
12
+
13
+ app.state.auth = service
14
+ app.include_router(router, prefix="/auth")
@@ -1,5 +1,5 @@
1
- from fastapi_auth_kit.db.sqlalchemy_repo import SQLRepo
2
- from fastapi_auth_kit.db.mongo_repo import MongoRepo
1
+ from fastapi_async_auth_kit.db.sqlalchemy_repo import SQLRepo
2
+ from fastapi_async_auth_kit.db.mongo_repo import MongoRepo
3
3
 
4
4
  async def get_repo(config):
5
5
  if config.db_type == "mongodb":
@@ -1,6 +1,6 @@
1
1
  from fastapi import Depends, HTTPException
2
2
  from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
3
- from fastapi_auth_kit.core.security import decode_token
3
+ from fastapi_async_auth_kit.core.security import decode_token
4
4
 
5
5
  security = HTTPBearer()
6
6
 
@@ -1,5 +1,5 @@
1
1
  from fastapi import HTTPException, status
2
- from fastapi_auth_kit.core.security import *
2
+ from fastapi_async_auth_kit.core.security import *
3
3
 
4
4
  class AuthService:
5
5
  def __init__(self, repo, secret):
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastapi-async-auth-kit
3
+ Version: 0.3.0
4
+ Summary: Production-ready FastAPI auth system with JWT, refresh tokens, and async DB support
5
+ Author-email: Keyurkumar <kmistry1110@gmail.com>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: fastapi
11
+ Requires-Dist: pydantic
12
+ Requires-Dist: python-jose
13
+ Requires-Dist: argon2-cffi
14
+ Requires-Dist: sqlalchemy>=2.0
15
+ Provides-Extra: postgres
16
+ Requires-Dist: asyncpg; extra == "postgres"
17
+ Provides-Extra: mysql
18
+ Requires-Dist: aiomysql; extra == "mysql"
19
+ Provides-Extra: sqlite
20
+ Requires-Dist: aiosqlite; extra == "sqlite"
21
+ Provides-Extra: mongodb
22
+ Requires-Dist: motor; extra == "mongodb"
23
+ Dynamic: license-file
24
+
25
+ # FastAPI Auth 🔐
26
+
27
+ Production-ready authentication system for FastAPI with async support, JWT, refresh tokens, and pluggable database backends.
28
+
29
+ ---
30
+
31
+ ## 🚀 Features
32
+
33
+ * ⚡ Fully async (no blocking I/O)
34
+ * 🔐 JWT authentication (access + refresh tokens)
35
+ * 🔁 Refresh token flow
36
+ * 🚪 Logout with token blacklist
37
+ * 🧱 Multi-database support:
38
+
39
+ * PostgreSQL (asyncpg)
40
+ * MySQL (aiomysql)
41
+ * SQLite (aiosqlite)
42
+ * MongoDB (motor)
43
+ * 🧠 Dependency-based auth (FastAPI native)
44
+ * 📦 Plug-and-play integration
45
+ * 🛡️ Password hashing with Argon2 (modern standard)
46
+ * 📄 Clean OpenAPI (Swagger) docs with Pydantic schemas
47
+
48
+ ---
49
+
50
+ ## 📦 Installation
51
+
52
+ ```bash
53
+ pip install "fastapi-async-auth-kit[<db>]"
54
+ ```
55
+
56
+ ### With database support
57
+
58
+ ```bash
59
+ pip install "fastapi-async-auth-kit[postgres]"
60
+ pip install "fastapi-async-auth-kit[mysql]"
61
+ pip install "fastapi-async-auth-kit[mongodb]"
62
+ pip install "fastapi-async-auth-kit[sqlite]"
63
+ ```
64
+
65
+ ---
66
+
67
+ ## ⚙️ Quick Start
68
+
69
+ ### Step 1: How to initiate auth on startup
70
+ ```python
71
+ from fastapi import FastAPI
72
+ from fastapi_auth_ import init_auth, AuthConfig
73
+
74
+ app = FastAPI()
75
+
76
+ @app.on_event("startup")
77
+ async def startup():
78
+ await init_auth(
79
+ app,
80
+ AuthConfig(
81
+ secret_key="your-secret",
82
+ db_url="postgresql+asyncpg://user:pass@localhost/db",
83
+ db_type="postgres"
84
+ )
85
+ )
86
+ ```
87
+
88
+ ### Step 2: How to validate token for all your FastAPIs
89
+ ```python
90
+ from fastapi import APIRouter, Depends
91
+ from fastapi_auth.dependencies.auth import get_current_user
92
+ router = APIRouter()
93
+
94
+ @router.get("/user")
95
+ async def me(user=Depends(get_current_user)):
96
+ return user
97
+ ```
98
+
99
+
100
+ ---
101
+
102
+ ## 🔐 Available Endpoints
103
+
104
+ | Endpoint | Description |
105
+ | ------------------- | ----------------------- |
106
+ | POST /auth/register | Register new user |
107
+ | POST /auth/login | Login and get tokens |
108
+ | POST /auth/refresh | Refresh access token |
109
+ | POST /auth/logout | Logout and revoke token |
110
+ | GET /auth/me | Get current user |
111
+
112
+ ---
113
+
114
+ ## 🧪 Example
115
+
116
+ ### Login
117
+
118
+ ```json
119
+ POST /auth/login
120
+
121
+ {
122
+ "username": "john",
123
+ "password": "Strong@123"
124
+ }
125
+ ```
126
+
127
+ ### Response
128
+
129
+ ```json
130
+ {
131
+ "access": "jwt_token",
132
+ "refresh": "refresh_token"
133
+ }
134
+ ```
135
+
136
+ ---
137
+
138
+ ## 🧠 Architecture
139
+
140
+ ```
141
+ FastAPI App
142
+
143
+ Auth Service
144
+
145
+ Repository Layer
146
+
147
+ Database (Async)
148
+ ```
149
+
150
+ ---
151
+
152
+ ## 🛡️ Security
153
+
154
+ * Argon2 password hashing
155
+ * JWT token expiration
156
+ * Refresh token blacklist
157
+ * No sensitive data exposure
158
+ * Clean error handling
159
+
160
+ ---
161
+
162
+ ## 🧩 Extensibility
163
+
164
+ * Add RBAC (roles & permissions)
165
+ * Plug custom user models
166
+ * Add OAuth providers (Google, GitHub)
167
+ * Integrate Redis for token storage
168
+
169
+ ---
170
+
171
+ ## 🛠 Tech Stack
172
+
173
+ * FastAPI
174
+ * SQLAlchemy (async)
175
+ * Pydantic
176
+ * python-jose (JWT)
177
+ * Argon2 (password hashing)
178
+
179
+ ---
180
+
181
+ ## 📌 Roadmap
182
+
183
+ * [ ] RBAC support
184
+ * [ ] Redis token blacklist
185
+ * [ ] OAuth integration
186
+ * [ ] Rate limiting
187
+ * [ ] Email verification
188
+
189
+ ---
190
+
191
+ ## 🤝 Contributing
192
+
193
+ Pull requests are welcome. For major changes, open an issue first.
194
+
195
+ ---
196
+
197
+ ## 📄 License
198
+
199
+ MIT License
@@ -0,0 +1,21 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ fastapi_async_auth_kit/__init__.py
5
+ fastapi_async_auth_kit.egg-info/PKG-INFO
6
+ fastapi_async_auth_kit.egg-info/SOURCES.txt
7
+ fastapi_async_auth_kit.egg-info/dependency_links.txt
8
+ fastapi_async_auth_kit.egg-info/requires.txt
9
+ fastapi_async_auth_kit.egg-info/top_level.txt
10
+ fastapi_async_auth_kit/api/auth.py
11
+ fastapi_async_auth_kit/core/config.py
12
+ fastapi_async_auth_kit/core/security.py
13
+ fastapi_async_auth_kit/core/setup.py
14
+ fastapi_async_auth_kit/db/base.py
15
+ fastapi_async_auth_kit/db/factory.py
16
+ fastapi_async_auth_kit/db/mongo_repo.py
17
+ fastapi_async_auth_kit/db/sqlalchemy_repo.py
18
+ fastapi_async_auth_kit/dependencies/auth.py
19
+ fastapi_async_auth_kit/schemas/auth.py
20
+ fastapi_async_auth_kit/services/auth_service.py
21
+ tests/test_auth.py
@@ -0,0 +1 @@
1
+ fastapi_async_auth_kit
@@ -1,8 +1,10 @@
1
1
  [project]
2
2
  name = "fastapi-async-auth-kit"
3
- version = "0.1.0"
4
- description = "Async FastAPI auth with JWT, refresh tokens, logout"
3
+ version = "0.3.0"
4
+ description = "Production-ready FastAPI auth system with JWT, refresh tokens, and async DB support"
5
+ readme = "README.md"
5
6
  authors = [{ name="Keyurkumar", email="kmistry1110@gmail.com" }]
7
+ license = "MIT"
6
8
  requires-python = ">=3.8"
7
9
 
8
10
  dependencies = [
@@ -25,4 +27,4 @@ build-backend = "setuptools.build_meta"
25
27
 
26
28
  [tool.setuptools.packages.find]
27
29
  where = ["."]
28
- include = ["fastapi_auth_kit*"]
30
+ include = ["fastapi_async_auth_kit*"]
@@ -1,7 +1,7 @@
1
1
  import pytest
2
2
  from httpx import AsyncClient
3
3
  from fastapi import FastAPI
4
- from fastapi_auth_kit import init_auth, AuthConfig
4
+ from fastapi_async_auth_kit import init_auth, AuthConfig
5
5
 
6
6
 
7
7
  @pytest.mark.asyncio
@@ -1,21 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: fastapi-async-auth-kit
3
- Version: 0.1.0
4
- Summary: Async FastAPI auth with JWT, refresh tokens, logout
5
- Author-email: Keyurkumar <kmistry1110@gmail.com>
6
- Requires-Python: >=3.8
7
- License-File: LICENSE
8
- Requires-Dist: fastapi
9
- Requires-Dist: pydantic
10
- Requires-Dist: python-jose
11
- Requires-Dist: argon2-cffi
12
- Requires-Dist: sqlalchemy>=2.0
13
- Provides-Extra: postgres
14
- Requires-Dist: asyncpg; extra == "postgres"
15
- Provides-Extra: mysql
16
- Requires-Dist: aiomysql; extra == "mysql"
17
- Provides-Extra: sqlite
18
- Requires-Dist: aiosqlite; extra == "sqlite"
19
- Provides-Extra: mongodb
20
- Requires-Dist: motor; extra == "mongodb"
21
- Dynamic: license-file
@@ -1,21 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: fastapi-async-auth-kit
3
- Version: 0.1.0
4
- Summary: Async FastAPI auth with JWT, refresh tokens, logout
5
- Author-email: Keyurkumar <kmistry1110@gmail.com>
6
- Requires-Python: >=3.8
7
- License-File: LICENSE
8
- Requires-Dist: fastapi
9
- Requires-Dist: pydantic
10
- Requires-Dist: python-jose
11
- Requires-Dist: argon2-cffi
12
- Requires-Dist: sqlalchemy>=2.0
13
- Provides-Extra: postgres
14
- Requires-Dist: asyncpg; extra == "postgres"
15
- Provides-Extra: mysql
16
- Requires-Dist: aiomysql; extra == "mysql"
17
- Provides-Extra: sqlite
18
- Requires-Dist: aiosqlite; extra == "sqlite"
19
- Provides-Extra: mongodb
20
- Requires-Dist: motor; extra == "mongodb"
21
- Dynamic: license-file
@@ -1,21 +0,0 @@
1
- LICENSE
2
- README.md
3
- pyproject.toml
4
- fastapi_async_auth_kit.egg-info/PKG-INFO
5
- fastapi_async_auth_kit.egg-info/SOURCES.txt
6
- fastapi_async_auth_kit.egg-info/dependency_links.txt
7
- fastapi_async_auth_kit.egg-info/requires.txt
8
- fastapi_async_auth_kit.egg-info/top_level.txt
9
- fastapi_auth_kit/__init__.py
10
- fastapi_auth_kit/api/auth.py
11
- fastapi_auth_kit/core/config.py
12
- fastapi_auth_kit/core/security.py
13
- fastapi_auth_kit/core/setup.py
14
- fastapi_auth_kit/db/base.py
15
- fastapi_auth_kit/db/factory.py
16
- fastapi_auth_kit/db/mongo_repo.py
17
- fastapi_auth_kit/db/sqlalchemy_repo.py
18
- fastapi_auth_kit/dependencies/auth.py
19
- fastapi_auth_kit/schemas/auth.py
20
- fastapi_auth_kit/services/auth_service.py
21
- tests/test_auth.py
@@ -1,5 +0,0 @@
1
- from fastapi_auth_kit.core.setup import init_auth
2
- from fastapi_auth_kit.core.config import AuthConfig
3
- from fastapi_auth_kit.dependencies.auth import get_current_user
4
-
5
- __all__ = ["init_auth", "AuthConfig", "get_current_user"]
@@ -1,14 +0,0 @@
1
- from fastapi_auth_kit.db.factory import get_repo
2
- from fastapi_auth_kit.services.auth_service import AuthService
3
- from fastapi_auth_kit.api.auth import router
4
- from fastapi_auth_kit.dependencies import auth
5
-
6
- async def init_auth(app, config):
7
- repo = await get_repo(config)
8
-
9
- service = AuthService(repo, config.secret_key)
10
-
11
- auth.SECRET = config.secret_key
12
-
13
- app.state.auth = service
14
- app.include_router(router, prefix="/auth")