fastapi-async-auth-kit 0.1.0__tar.gz → 0.2.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 (25) hide show
  1. fastapi_async_auth_kit-0.2.0/PKG-INFO +199 -0
  2. fastapi_async_auth_kit-0.2.0/fastapi_async_auth_kit.egg-info/PKG-INFO +199 -0
  3. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/pyproject.toml +4 -2
  4. fastapi_async_auth_kit-0.1.0/PKG-INFO +0 -21
  5. fastapi_async_auth_kit-0.1.0/fastapi_async_auth_kit.egg-info/PKG-INFO +0 -21
  6. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/LICENSE +0 -0
  7. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/README.md +0 -0
  8. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_async_auth_kit.egg-info/SOURCES.txt +0 -0
  9. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_async_auth_kit.egg-info/dependency_links.txt +0 -0
  10. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_async_auth_kit.egg-info/requires.txt +0 -0
  11. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_async_auth_kit.egg-info/top_level.txt +0 -0
  12. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_auth_kit/__init__.py +0 -0
  13. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_auth_kit/api/auth.py +0 -0
  14. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_auth_kit/core/config.py +0 -0
  15. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_auth_kit/core/security.py +0 -0
  16. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_auth_kit/core/setup.py +0 -0
  17. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_auth_kit/db/base.py +0 -0
  18. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_auth_kit/db/factory.py +0 -0
  19. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_auth_kit/db/mongo_repo.py +0 -0
  20. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_auth_kit/db/sqlalchemy_repo.py +0 -0
  21. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_auth_kit/dependencies/auth.py +0 -0
  22. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_auth_kit/schemas/auth.py +0 -0
  23. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/fastapi_auth_kit/services/auth_service.py +0 -0
  24. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/setup.cfg +0 -0
  25. {fastapi_async_auth_kit-0.1.0 → fastapi_async_auth_kit-0.2.0}/tests/test_auth.py +0 -0
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastapi-async-auth-kit
3
+ Version: 0.2.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: 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-auth[<db>]
54
+ ```
55
+
56
+ ### With database support
57
+
58
+ ```bash
59
+ pip install fastapi-auth[postgres]
60
+ pip install fastapi-auth[mysql]
61
+ pip install fastapi-auth[mongodb]
62
+ pip install fastapi-auth[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,199 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastapi-async-auth-kit
3
+ Version: 0.2.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: 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-auth[<db>]
54
+ ```
55
+
56
+ ### With database support
57
+
58
+ ```bash
59
+ pip install fastapi-auth[postgres]
60
+ pip install fastapi-auth[mysql]
61
+ pip install fastapi-auth[mongodb]
62
+ pip install fastapi-auth[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
@@ -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.2.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 = {text = "MIT"}
6
8
  requires-python = ">=3.8"
7
9
 
8
10
  dependencies = [
@@ -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