Skip to main content

Shared Casdoor authentication client for Blade ecosystem services.

Project description

blade-auth-client

blade-auth-client 是 Blade 生态的共享 Casdoor 认证客户端包。它抽离了统一的 token 校验、FastAPI 装配和 Socket.IO 握手接口,供各个服务复用。

安装

pip install blade-auth-client[fastapi,socketio]

Casdoor 配置要求

Casdoor 的 application、scope 和 redirect URI 约束见 docs/casdoor-setup.md

快速上手

from fastapi import FastAPI

from blade_auth_client import (
    AuthConfig,
    OidcClient,
    TokenVerifier,
    create_auth_router,
    make_current_user_dep,
)

app = FastAPI()
config = AuthConfig()
oidc_client = OidcClient(config)
verifier = TokenVerifier(config)
current_user = make_current_user_dep(config, verifier=verifier, provisioner=...)

app.include_router(
    create_auth_router(config, verifier=verifier, provisioner=..., oidc_client=oidc_client)
)

版本策略

0.0.x 版本仅用于占位发布和联调验证,不承诺可用性。0.2.0 起采用仅校验 iss + 签名 + exp 的简化策略。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blade_auth_client-0.2.0.tar.gz (51.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blade_auth_client-0.2.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file blade_auth_client-0.2.0.tar.gz.

File metadata

  • Download URL: blade_auth_client-0.2.0.tar.gz
  • Upload date:
  • Size: 51.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for blade_auth_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 655dd4d644ea6e5aef5fd932e018ae3447ad699928d54c5a577c86a740a012f4
MD5 1f401f4b9633c869ff1c6010a8392df9
BLAKE2b-256 5fdb6b811d2acf58225b5afc0814d569b69ed8262e282b50d6bed27fb660253c

See more details on using hashes here.

File details

Details for the file blade_auth_client-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for blade_auth_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e44781c1975ae36c7919bb8badd6b34ee496dbab519e6e20184aae0db10771d
MD5 4c82b7da1204473fcf1a6ac4f4c4b215
BLAKE2b-256 5a41ca1149a7af5b6f89f3ab277bb20a891dad69f6525de93899ec227c99114a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page