Expand description
WeCom 认证能力库:凭证存储、Token Provider 与 AI Bot CLI 网关协议。
与运行方式(CLI / 服务端 / Agent)无关的认证构件:
bot:Bot 凭据(botid + secret);credentials:CredentialStore抽象与MemoryCredentialStore内存实现;file_store:EncryptedFileCredentialStore(AES-256-GCM 加密文件 + keyring 回退);provider:TokenProvider抽象与BotGatewayTokenProvider(botid+secret 签名引导换取 Bearer token,含并发刷新合并);bootstrap:sha256_hex(secret + bot_id + time + nonce)签名与引导调用;gateway:AI Bot CLI 网关协议(扁平响应信封 + 鉴权能力标记 + 引导端点装配);qrcode:扫码登录的网络流程(创建会话 → 轮询结果);legacy_migration:旧版凭据(bot.enc/token.enc)自动迁移;error:统一错误AuthError(错误码段 893300–893399)。
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
- 凭据存储抽象:
CredentialStoretrait 与内存实现。 - 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.enc→credentials.enc)。 - provider
- Token Provider:访问令牌的读取与刷新抽象。
- qrcode
- 扫码登录的网络流程:创建二维码会话 → 轮询扫码结果。