Skip to main content

Crate wecomx_auth

Crate wecomx_auth 

Source
Expand description

WeCom 认证能力库:凭证存储、Token Provider 与 AI Bot CLI 网关协议。

与运行方式(CLI / 服务端 / Agent)无关的认证构件:

Re-exports§

pub use bootstrap::BindSource;
pub use bootstrap::FetchAuthRequest;
pub use bootstrap::FetchAuthResponse;
pub use bootstrap::fetch_auth;
pub use bootstrap::sign;
pub use bot::BotCredential;
pub use credentials::CredentialStore;
pub use credentials::Credentials;
pub use credentials::MemoryCredentialStore;
pub use error::AuthError;
pub use file_store::EncryptedFileCredentialStore;
pub use gateway::DEFAULT_AUTH_ENDPOINT;
pub use gateway::FlatRes;
pub use gateway::NestedRes;
pub use gateway::RequireAuth;
pub use gateway::SuppressAuth;
pub use gateway::auth_endpoint;
pub use legacy_migration::try_migrate_legacy_credentials;
pub use provider::AccessToken;
pub use provider::BotGatewayTokenProvider;
pub use provider::TokenProvider;
pub use qrcode::QrSession;

Modules§

bootstrap
鉴权引导:botid+secret 签名调用换取 Bearer token。
bot
credentials
凭据存储抽象:CredentialStore trait 与内存实现。
crypto
Crypto utilities for secure credential storage.
error
wecomx-auth 统一错误(错误码段 893300–893399)。
file_store
加密文件凭据存储:AES-256-GCM 加密的 credentials.enc + keyring 回退。
gateway
AI Bot CLI 网关协议:扁平响应信封与鉴权能力标记。
legacy_migration
旧版凭据自动迁移(legacy bot.enc/token.enccredentials.enc)。
provider
Token Provider:访问令牌的读取与刷新抽象。
qrcode
扫码登录的网络流程:创建二维码会话 → 轮询扫码结果。