the37lab-authlib 0.1.1750156111__tar.gz → 0.1.1750187527__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 the37lab-authlib might be problematic. Click here for more details.
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/PKG-INFO +15 -15
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/README.md +14 -14
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/pyproject.toml +1 -1
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib/auth.py +1 -1
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib.egg-info/PKG-INFO +15 -15
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/setup.cfg +0 -0
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib/__init__.py +0 -0
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib/db.py +0 -0
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib/decorators.py +0 -0
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib/exceptions.py +0 -0
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib/models.py +0 -0
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib.egg-info/SOURCES.txt +0 -0
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib.egg-info/dependency_links.txt +0 -0
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib.egg-info/requires.txt +0 -0
- {the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: the37lab_authlib
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1750187527
|
|
4
4
|
Summary: Python SDK for the Authlib
|
|
5
5
|
Author-email: the37lab <info@the37lab.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -101,48 +101,48 @@ def protected_route():
|
|
|
101
101
|
## API Endpoints
|
|
102
102
|
|
|
103
103
|
### Authentication
|
|
104
|
-
- `POST /v1/users/login` - Login with username/password
|
|
104
|
+
- `POST /api/v1/users/login` - Login with username/password
|
|
105
105
|
- **Request:** `{ "username": "string", "password": "string" }`
|
|
106
106
|
- **Response:** `{ "token": "jwt", "refresh_token": "jwt", "user": { ... } }`
|
|
107
|
-
- `POST /v1/users/login/oauth` - Get OAuth redirect URL
|
|
107
|
+
- `POST /api/v1/users/login/oauth` - Get OAuth redirect URL
|
|
108
108
|
- **Request:** `{ "provider": "google|github|..." }`
|
|
109
109
|
- **Response:** `{ "redirect_url": "string" }`
|
|
110
|
-
- `GET /v1/users/login/oauth2callback` - OAuth callback
|
|
110
|
+
- `GET /api/v1/users/login/oauth2callback` - OAuth callback
|
|
111
111
|
- **Query Params:** `code`, `state`, `provider`
|
|
112
112
|
- **Response:** `{ "token": "jwt", "refresh_token": "jwt", "user": { ... } }`
|
|
113
|
-
- `POST /v1/users/token-refresh` - Refresh JWT token
|
|
113
|
+
- `POST /api/v1/users/token-refresh` - Refresh JWT token
|
|
114
114
|
- **Request:** `{ "refresh_token": "jwt" }`
|
|
115
115
|
- **Response:** `{ "token": "jwt", "refresh_token": "jwt" }`
|
|
116
116
|
|
|
117
117
|
### User Management
|
|
118
|
-
- `POST /v1/users/register` - Register new user
|
|
118
|
+
- `POST /api/v1/users/register` - Register new user
|
|
119
119
|
- **Request:** `{ "username": "string", "password": "string", "email": "string", ... }`
|
|
120
120
|
- **Response:** `{ "user": { ... }, "token": "jwt", "refresh_token": "jwt" }`
|
|
121
|
-
- `GET /v1/users/login/profile` - Get user profile
|
|
121
|
+
- `GET /api/v1/users/login/profile` - Get user profile
|
|
122
122
|
- **Auth:** Bearer JWT
|
|
123
123
|
- **Response:** `{ "user": { ... } }`
|
|
124
|
-
- `GET /v1/users/roles` - Get available roles
|
|
124
|
+
- `GET /api/v1/users/roles` - Get available roles
|
|
125
125
|
- **Response:** `[ "admin", "user", ... ]`
|
|
126
126
|
|
|
127
127
|
### API Tokens
|
|
128
|
-
- `POST /v1/users/{user}/api-tokens` - Create API token
|
|
128
|
+
- `POST /api/v1/users/{user}/api-tokens` - Create API token
|
|
129
129
|
- **Request:** `{ "name": "string", "scopes": [ ... ] }`
|
|
130
130
|
- **Response:** `{ "token": "string", "id": "uuid", ... }`
|
|
131
|
-
- `GET /v1/users/{user}/api-tokens` - List API tokens
|
|
131
|
+
- `GET /api/v1/users/{user}/api-tokens` - List API tokens
|
|
132
132
|
- **Response:** `[ { "id": "uuid", "name": "string", ... } ]`
|
|
133
|
-
- `DELETE /v1/users/{user}/api-tokens/{token_id}` - Delete API token
|
|
133
|
+
- `DELETE /api/v1/users/{user}/api-tokens/{token_id}` - Delete API token
|
|
134
134
|
- **Response:** `{ "success": true }`
|
|
135
135
|
|
|
136
136
|
## Authentication Flow
|
|
137
137
|
|
|
138
138
|
1. **Login:**
|
|
139
|
-
- User submits credentials to `/v1/users/login`.
|
|
139
|
+
- User submits credentials to `/api/v1/users/login`.
|
|
140
140
|
- Receives JWT and refresh token.
|
|
141
141
|
2. **Token Refresh:**
|
|
142
|
-
- Use `/v1/users/token-refresh` with refresh token to get new JWT.
|
|
142
|
+
- Use `/api/v1/users/token-refresh` with refresh token to get new JWT.
|
|
143
143
|
3. **OAuth:**
|
|
144
|
-
- Get redirect URL from `/v1/users/login/oauth`.
|
|
145
|
-
- Complete OAuth flow via `/v1/users/login/oauth2callback`.
|
|
144
|
+
- Get redirect URL from `/api/v1/users/login/oauth`.
|
|
145
|
+
- Complete OAuth flow via `/api/v1/users/login/oauth2callback`.
|
|
146
146
|
4. **Protected Routes:**
|
|
147
147
|
- Use `@auth.require_auth()` decorator to protect Flask routes.
|
|
148
148
|
|
|
@@ -84,48 +84,48 @@ def protected_route():
|
|
|
84
84
|
## API Endpoints
|
|
85
85
|
|
|
86
86
|
### Authentication
|
|
87
|
-
- `POST /v1/users/login` - Login with username/password
|
|
87
|
+
- `POST /api/v1/users/login` - Login with username/password
|
|
88
88
|
- **Request:** `{ "username": "string", "password": "string" }`
|
|
89
89
|
- **Response:** `{ "token": "jwt", "refresh_token": "jwt", "user": { ... } }`
|
|
90
|
-
- `POST /v1/users/login/oauth` - Get OAuth redirect URL
|
|
90
|
+
- `POST /api/v1/users/login/oauth` - Get OAuth redirect URL
|
|
91
91
|
- **Request:** `{ "provider": "google|github|..." }`
|
|
92
92
|
- **Response:** `{ "redirect_url": "string" }`
|
|
93
|
-
- `GET /v1/users/login/oauth2callback` - OAuth callback
|
|
93
|
+
- `GET /api/v1/users/login/oauth2callback` - OAuth callback
|
|
94
94
|
- **Query Params:** `code`, `state`, `provider`
|
|
95
95
|
- **Response:** `{ "token": "jwt", "refresh_token": "jwt", "user": { ... } }`
|
|
96
|
-
- `POST /v1/users/token-refresh` - Refresh JWT token
|
|
96
|
+
- `POST /api/v1/users/token-refresh` - Refresh JWT token
|
|
97
97
|
- **Request:** `{ "refresh_token": "jwt" }`
|
|
98
98
|
- **Response:** `{ "token": "jwt", "refresh_token": "jwt" }`
|
|
99
99
|
|
|
100
100
|
### User Management
|
|
101
|
-
- `POST /v1/users/register` - Register new user
|
|
101
|
+
- `POST /api/v1/users/register` - Register new user
|
|
102
102
|
- **Request:** `{ "username": "string", "password": "string", "email": "string", ... }`
|
|
103
103
|
- **Response:** `{ "user": { ... }, "token": "jwt", "refresh_token": "jwt" }`
|
|
104
|
-
- `GET /v1/users/login/profile` - Get user profile
|
|
104
|
+
- `GET /api/v1/users/login/profile` - Get user profile
|
|
105
105
|
- **Auth:** Bearer JWT
|
|
106
106
|
- **Response:** `{ "user": { ... } }`
|
|
107
|
-
- `GET /v1/users/roles` - Get available roles
|
|
107
|
+
- `GET /api/v1/users/roles` - Get available roles
|
|
108
108
|
- **Response:** `[ "admin", "user", ... ]`
|
|
109
109
|
|
|
110
110
|
### API Tokens
|
|
111
|
-
- `POST /v1/users/{user}/api-tokens` - Create API token
|
|
111
|
+
- `POST /api/v1/users/{user}/api-tokens` - Create API token
|
|
112
112
|
- **Request:** `{ "name": "string", "scopes": [ ... ] }`
|
|
113
113
|
- **Response:** `{ "token": "string", "id": "uuid", ... }`
|
|
114
|
-
- `GET /v1/users/{user}/api-tokens` - List API tokens
|
|
114
|
+
- `GET /api/v1/users/{user}/api-tokens` - List API tokens
|
|
115
115
|
- **Response:** `[ { "id": "uuid", "name": "string", ... } ]`
|
|
116
|
-
- `DELETE /v1/users/{user}/api-tokens/{token_id}` - Delete API token
|
|
116
|
+
- `DELETE /api/v1/users/{user}/api-tokens/{token_id}` - Delete API token
|
|
117
117
|
- **Response:** `{ "success": true }`
|
|
118
118
|
|
|
119
119
|
## Authentication Flow
|
|
120
120
|
|
|
121
121
|
1. **Login:**
|
|
122
|
-
- User submits credentials to `/v1/users/login`.
|
|
122
|
+
- User submits credentials to `/api/v1/users/login`.
|
|
123
123
|
- Receives JWT and refresh token.
|
|
124
124
|
2. **Token Refresh:**
|
|
125
|
-
- Use `/v1/users/token-refresh` with refresh token to get new JWT.
|
|
125
|
+
- Use `/api/v1/users/token-refresh` with refresh token to get new JWT.
|
|
126
126
|
3. **OAuth:**
|
|
127
|
-
- Get redirect URL from `/v1/users/login/oauth`.
|
|
128
|
-
- Complete OAuth flow via `/v1/users/login/oauth2callback`.
|
|
127
|
+
- Get redirect URL from `/api/v1/users/login/oauth`.
|
|
128
|
+
- Complete OAuth flow via `/api/v1/users/login/oauth2callback`.
|
|
129
129
|
4. **Protected Routes:**
|
|
130
130
|
- Use `@auth.require_auth()` decorator to protect Flask routes.
|
|
131
131
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "the37lab_authlib"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.1750187527"
|
|
8
8
|
description = "Python SDK for the Authlib"
|
|
9
9
|
authors = [{name = "the37lab", email = "info@the37lab.com"}]
|
|
10
10
|
dependencies = ["flask", "psycopg2-binary", "pyjwt", "python-dotenv", "requests", "authlib", "bcrypt"]
|
{the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib/auth.py
RENAMED
|
@@ -130,7 +130,7 @@ class AuthManager:
|
|
|
130
130
|
app.register_blueprint(self.create_blueprint())
|
|
131
131
|
|
|
132
132
|
def create_blueprint(self):
|
|
133
|
-
bp = Blueprint('auth', __name__, url_prefix='/v1/users')
|
|
133
|
+
bp = Blueprint('auth', __name__, url_prefix='/api/v1/users')
|
|
134
134
|
|
|
135
135
|
@bp.route('/login', methods=['POST'])
|
|
136
136
|
@handle_auth_errors
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: the37lab_authlib
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1750187527
|
|
4
4
|
Summary: Python SDK for the Authlib
|
|
5
5
|
Author-email: the37lab <info@the37lab.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -101,48 +101,48 @@ def protected_route():
|
|
|
101
101
|
## API Endpoints
|
|
102
102
|
|
|
103
103
|
### Authentication
|
|
104
|
-
- `POST /v1/users/login` - Login with username/password
|
|
104
|
+
- `POST /api/v1/users/login` - Login with username/password
|
|
105
105
|
- **Request:** `{ "username": "string", "password": "string" }`
|
|
106
106
|
- **Response:** `{ "token": "jwt", "refresh_token": "jwt", "user": { ... } }`
|
|
107
|
-
- `POST /v1/users/login/oauth` - Get OAuth redirect URL
|
|
107
|
+
- `POST /api/v1/users/login/oauth` - Get OAuth redirect URL
|
|
108
108
|
- **Request:** `{ "provider": "google|github|..." }`
|
|
109
109
|
- **Response:** `{ "redirect_url": "string" }`
|
|
110
|
-
- `GET /v1/users/login/oauth2callback` - OAuth callback
|
|
110
|
+
- `GET /api/v1/users/login/oauth2callback` - OAuth callback
|
|
111
111
|
- **Query Params:** `code`, `state`, `provider`
|
|
112
112
|
- **Response:** `{ "token": "jwt", "refresh_token": "jwt", "user": { ... } }`
|
|
113
|
-
- `POST /v1/users/token-refresh` - Refresh JWT token
|
|
113
|
+
- `POST /api/v1/users/token-refresh` - Refresh JWT token
|
|
114
114
|
- **Request:** `{ "refresh_token": "jwt" }`
|
|
115
115
|
- **Response:** `{ "token": "jwt", "refresh_token": "jwt" }`
|
|
116
116
|
|
|
117
117
|
### User Management
|
|
118
|
-
- `POST /v1/users/register` - Register new user
|
|
118
|
+
- `POST /api/v1/users/register` - Register new user
|
|
119
119
|
- **Request:** `{ "username": "string", "password": "string", "email": "string", ... }`
|
|
120
120
|
- **Response:** `{ "user": { ... }, "token": "jwt", "refresh_token": "jwt" }`
|
|
121
|
-
- `GET /v1/users/login/profile` - Get user profile
|
|
121
|
+
- `GET /api/v1/users/login/profile` - Get user profile
|
|
122
122
|
- **Auth:** Bearer JWT
|
|
123
123
|
- **Response:** `{ "user": { ... } }`
|
|
124
|
-
- `GET /v1/users/roles` - Get available roles
|
|
124
|
+
- `GET /api/v1/users/roles` - Get available roles
|
|
125
125
|
- **Response:** `[ "admin", "user", ... ]`
|
|
126
126
|
|
|
127
127
|
### API Tokens
|
|
128
|
-
- `POST /v1/users/{user}/api-tokens` - Create API token
|
|
128
|
+
- `POST /api/v1/users/{user}/api-tokens` - Create API token
|
|
129
129
|
- **Request:** `{ "name": "string", "scopes": [ ... ] }`
|
|
130
130
|
- **Response:** `{ "token": "string", "id": "uuid", ... }`
|
|
131
|
-
- `GET /v1/users/{user}/api-tokens` - List API tokens
|
|
131
|
+
- `GET /api/v1/users/{user}/api-tokens` - List API tokens
|
|
132
132
|
- **Response:** `[ { "id": "uuid", "name": "string", ... } ]`
|
|
133
|
-
- `DELETE /v1/users/{user}/api-tokens/{token_id}` - Delete API token
|
|
133
|
+
- `DELETE /api/v1/users/{user}/api-tokens/{token_id}` - Delete API token
|
|
134
134
|
- **Response:** `{ "success": true }`
|
|
135
135
|
|
|
136
136
|
## Authentication Flow
|
|
137
137
|
|
|
138
138
|
1. **Login:**
|
|
139
|
-
- User submits credentials to `/v1/users/login`.
|
|
139
|
+
- User submits credentials to `/api/v1/users/login`.
|
|
140
140
|
- Receives JWT and refresh token.
|
|
141
141
|
2. **Token Refresh:**
|
|
142
|
-
- Use `/v1/users/token-refresh` with refresh token to get new JWT.
|
|
142
|
+
- Use `/api/v1/users/token-refresh` with refresh token to get new JWT.
|
|
143
143
|
3. **OAuth:**
|
|
144
|
-
- Get redirect URL from `/v1/users/login/oauth`.
|
|
145
|
-
- Complete OAuth flow via `/v1/users/login/oauth2callback`.
|
|
144
|
+
- Get redirect URL from `/api/v1/users/login/oauth`.
|
|
145
|
+
- Complete OAuth flow via `/api/v1/users/login/oauth2callback`.
|
|
146
146
|
4. **Protected Routes:**
|
|
147
147
|
- Use `@auth.require_auth()` decorator to protect Flask routes.
|
|
148
148
|
|
|
File without changes
|
{the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib/__init__.py
RENAMED
|
File without changes
|
{the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib/db.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{the37lab_authlib-0.1.1750156111 → the37lab_authlib-0.1.1750187527}/src/the37lab_authlib/models.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|