Skip to main content

ChatLogin

ChatLogin 是面向 Python-backed 网站的可复用登录能力包:后端统一处理身份、认证、会话、CSRF、回跳和角色边界;前端可以使用默认模板、覆盖模板/CSS,或保留网站原有 HTML/JS 走 headless JSON API。

文档入口:https://arch.gh.wzhecnu.cn/ChatLogin/

场景 文档
FastAPI 快速接入 Python 接口树
默认 UI、模板覆盖与 headless 能力地图
CLI 版本和命令树 CLI 树

安装

pip install "ChatLogin[web]"

核心包不要求网站采用包内页面。已有静态 HTML/原生 JS 的网站可以只挂载 JSON 路由,继续保留原登录入口和用户数据库。

设计边界

  • guest / user / admin 是服务端可信身份,角色不能由请求体指定。
  • 固定账号、多账号和宿主回调均可;已有 PBKDF2 密码材料可验证,不强制迁移。
  • 会话 token 只以 SHA-256 摘要持久化,支持 TTL、轮换、撤销、CSRF 和实例隔离。
  • FastAPI adapter 默认同站 Origin/Host 校验、请求体大小限制、限流和安全 next。
  • 默认模板提供色系、布局与浅色/深色/跟随系统选项;宿主可覆盖局部或整页,也可保留原 HTML/JS 走 headless。
  • Admin 不自动绕过资源 owner;业务数据授权仍由宿主决定。
  • 不提供默认生产密码、独立登录微服务、SSO/OAuth、MFA 或账户管理后台。

开发与验证

python -m pip install -e ".[dev,docs]"
chatlogin --version
chatlogin --tree
python -m pytest -q
python -m build
python -m twine check dist/*
mkdocs build --strict

可运行的 FastAPI 合成账号示例:examples/demo_fastapi.py。

Metadata

Release files for ChatLogin 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ChatLogin 0.1.1
File Size Uploaded
chatlogin-0.1.1.tar.gz 51.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ChatLogin 0.1.1
File Interpreter ABI Platform
chatlogin-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 76.5 kB

Release files / chatlogin-0.1.1.tar.gz

Download URL chatlogin-0.1.1.tar.gz
Size 51.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ac7c8a740869e6a8afc2bb6c3af9eb98808216cd9b918278fe964e7979895fe4
BLAKE2b-256 checksum
How to use checksums
9137006e7c59950cc18d89c6bd7f9bddc8d30af6c44598fe3a39f0a8113d5d57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / chatlogin-0.1.1-py3-none-any.whl

Download URL chatlogin-0.1.1-py3-none-any.whl
Size 24.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f535355eadae6440e113a6cdc301a275a1b3cbe858479260d27c5980cf86190
BLAKE2b-256 checksum
How to use checksums
eaea576b6a5c0466918a295540ab876e81a45ce2eb79e02d7e14f0539964d070
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page