sa-token-python-core 0.1.1__tar.gz → 0.1.2__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.
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/PKG-INFO +9 -6
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/README.md +7 -4
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/pyproject.toml +2 -2
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/manager.py +1 -1
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/.github/workflows/ci.yml +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/.gitignore +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/LICENSE +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/examples/fastapi/main.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/examples/flask/main.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/examples/native/quick_start.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/__init__.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/adapter/__init__.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/adapter/http.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/adapter/path.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/adapter/pipeline.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/config.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/context.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/exception.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/integration/__init__.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/integration/django.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/integration/fastapi.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/integration/fastapi_oauth2.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/integration/flask.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/integration/starlette.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/listener.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/model.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/oauth2/__init__.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/oauth2/model.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/oauth2/server.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/online/__init__.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/permission.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/py.typed +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/security/__init__.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/security/nonce.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/security/refresh.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/security/temp_token.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/session.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/sso/__init__.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/storage/__init__.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/storage/base.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/storage/memory.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/storage/redis.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/stp_interface.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/stp_logic.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/stp_util.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/strategy/__init__.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/strategy/base.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/strategy/builtin.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/strategy/jwt.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/sync.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/token_io.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/conftest.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/test_adapter.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/test_auth.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/test_authorization.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/test_core_isolation.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/test_extensions.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/test_integration_fastapi.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/test_integration_fastapi_oauth2.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/test_integration_flask.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/test_optional_backends.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/test_permission.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/test_security.py +0 -0
- {sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/test_storage_and_token.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: sa-token-python-core
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: 有状态 Token 认证与权限鉴权框架(轻量核心)。灵感来源于 Java 的 Sa-Token
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: 有状态 Token 认证与权限鉴权框架(轻量核心)。灵感来源于 Java 的 Sa-Token。常用依赖请安装 sa-token-python;Web 框架按 extras 安装。
|
|
5
5
|
Project-URL: Homepage, https://github.com/Star-yb/sa-token-python
|
|
6
6
|
Project-URL: Documentation, https://github.com/Star-yb/sa-token-python
|
|
7
7
|
Project-URL: Source, https://github.com/Star-yb/sa-token-python
|
|
@@ -91,8 +91,11 @@ token = await StpUtil.login(user_id)
|
|
|
91
91
|
Python 3.10+。两个发行名,导入均为 `sa_token`。
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
|
-
pip install sa-token-python #
|
|
95
|
-
pip install "sa-token-python[
|
|
94
|
+
pip install sa-token-python # 核心 + Redis / JWT(不含 Web 框架)
|
|
95
|
+
pip install "sa-token-python[fastapi]" # 再加上 FastAPI / Starlette
|
|
96
|
+
pip install "sa-token-python[flask]" # 再加上 Flask
|
|
97
|
+
pip install "sa-token-python[django]" # 再加上 Django
|
|
98
|
+
pip install "sa-token-python[full]" # Redis / JWT / 全部框架适配
|
|
96
99
|
|
|
97
100
|
pip install sa-token-python-core # 轻量:核心 + 内存存储
|
|
98
101
|
pip install "sa-token-python-core[redis]" # Redis 存储
|
|
@@ -100,7 +103,7 @@ pip install "sa-token-python-core[jwt]" # JWT token 风格
|
|
|
100
103
|
pip install "sa-token-python-core[fastapi]" # FastAPI / Starlette
|
|
101
104
|
pip install "sa-token-python-core[flask]" # Flask
|
|
102
105
|
pip install "sa-token-python-core[django]" # Django
|
|
103
|
-
pip install "sa-token-python-core[full]" # 与 pip install sa-token-python 相同
|
|
106
|
+
pip install "sa-token-python-core[full]" # 与 pip install "sa-token-python[full]" 相同
|
|
104
107
|
```
|
|
105
108
|
|
|
106
109
|
也可按需组合 extras,例如 `"sa-token-python-core[redis,jwt,fastapi]"`。
|
|
@@ -484,7 +487,7 @@ def delete_order(order_id):
|
|
|
484
487
|
|
|
485
488
|
Django 自带 `django.contrib.auth`(Session + User 模型)。本库**不是**去替换它,而是给 **纯 API / DRF** 项目提供与 FastAPI、Flask 一致的 Token 鉴权。模板站点继续用 Django Auth 即可。
|
|
486
489
|
|
|
487
|
-
安装:`pip install "sa-token-python
|
|
490
|
+
安装:`pip install "sa-token-python[django]"` 或 `pip install "sa-token-python-core[django]"`。Django 是同步 WSGI,一律走 `StpUtilSync`。
|
|
488
491
|
|
|
489
492
|
### 1. 启动时初始化
|
|
490
493
|
|
|
@@ -41,8 +41,11 @@ token = await StpUtil.login(user_id)
|
|
|
41
41
|
Python 3.10+。两个发行名,导入均为 `sa_token`。
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
pip install sa-token-python #
|
|
45
|
-
pip install "sa-token-python[
|
|
44
|
+
pip install sa-token-python # 核心 + Redis / JWT(不含 Web 框架)
|
|
45
|
+
pip install "sa-token-python[fastapi]" # 再加上 FastAPI / Starlette
|
|
46
|
+
pip install "sa-token-python[flask]" # 再加上 Flask
|
|
47
|
+
pip install "sa-token-python[django]" # 再加上 Django
|
|
48
|
+
pip install "sa-token-python[full]" # Redis / JWT / 全部框架适配
|
|
46
49
|
|
|
47
50
|
pip install sa-token-python-core # 轻量:核心 + 内存存储
|
|
48
51
|
pip install "sa-token-python-core[redis]" # Redis 存储
|
|
@@ -50,7 +53,7 @@ pip install "sa-token-python-core[jwt]" # JWT token 风格
|
|
|
50
53
|
pip install "sa-token-python-core[fastapi]" # FastAPI / Starlette
|
|
51
54
|
pip install "sa-token-python-core[flask]" # Flask
|
|
52
55
|
pip install "sa-token-python-core[django]" # Django
|
|
53
|
-
pip install "sa-token-python-core[full]" # 与 pip install sa-token-python 相同
|
|
56
|
+
pip install "sa-token-python-core[full]" # 与 pip install "sa-token-python[full]" 相同
|
|
54
57
|
```
|
|
55
58
|
|
|
56
59
|
也可按需组合 extras,例如 `"sa-token-python-core[redis,jwt,fastapi]"`。
|
|
@@ -434,7 +437,7 @@ def delete_order(order_id):
|
|
|
434
437
|
|
|
435
438
|
Django 自带 `django.contrib.auth`(Session + User 模型)。本库**不是**去替换它,而是给 **纯 API / DRF** 项目提供与 FastAPI、Flask 一致的 Token 鉴权。模板站点继续用 Django Auth 即可。
|
|
436
439
|
|
|
437
|
-
安装:`pip install "sa-token-python
|
|
440
|
+
安装:`pip install "sa-token-python[django]"` 或 `pip install "sa-token-python-core[django]"`。Django 是同步 WSGI,一律走 `StpUtilSync`。
|
|
438
441
|
|
|
439
442
|
### 1. 启动时初始化
|
|
440
443
|
|
|
@@ -4,8 +4,8 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "sa-token-python-core"
|
|
7
|
-
version = "0.1.
|
|
8
|
-
description = "有状态 Token 认证与权限鉴权框架(轻量核心)。灵感来源于 Java 的 Sa-Token
|
|
7
|
+
version = "0.1.2"
|
|
8
|
+
description = "有状态 Token 认证与权限鉴权框架(轻量核心)。灵感来源于 Java 的 Sa-Token。常用依赖请安装 sa-token-python;Web 框架按 extras 安装。"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
license = { text = "Apache-2.0" }
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/integration/__init__.py
RENAMED
|
File without changes
|
{sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/integration/django.py
RENAMED
|
File without changes
|
{sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/integration/fastapi.py
RENAMED
|
File without changes
|
{sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/integration/fastapi_oauth2.py
RENAMED
|
File without changes
|
|
File without changes
|
{sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/integration/starlette.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
|
|
File without changes
|
{sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/src/sa_token/security/temp_token.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
|
|
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
|
|
File without changes
|
{sa_token_python_core-0.1.1 → sa_token_python_core-0.1.2}/tests/test_integration_fastapi_oauth2.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|