Skip to content

v1.1.39

Latest

Choose a tag to compare

@github-actions github-actions released this 16 Jul 02:53

kiro-rs v1.1.39

本版新增 api_key 账号类型的批量导入,参考 Kiro-Go 的 api_key 实现融入。kiro-rs 此前已支持 api_key 账号的数据面(tokentype: API_KEY 头、跳过 profileArn 解析、单个添加),本版补齐批量导入这一缺口。

This release adds bulk import for api_key-type accounts, ported from Kiro-Go's api_key implementation. kiro-rs already supported the api_key data plane (tokentype: API_KEY header, skipping profileArn resolution, single-account add); this release fills the remaining gap — batch import.


中文更新日志

新增

  • api_key 凭据批量导入 — 复用现有 /api/admin/credentials/import-token-json 端点(不新增路由),新增 api_key 识别分支:无 refreshToken 时以 kiroApiKey 作为凭据落库,authMethod=api_key、不解析 profileArn、永不进入刷新路径。落库前实测调用 usage-limits 端点验活,无效 key(403)直接拒绝,不留死凭据。按完整 kiroApiKey 字符串去重。
  • 三种 api_key 导入输入格式 — 导入弹窗同时支持:①纯文本每行一个 API key(非 JSON 输入自动按换行拆分,# 开头为注释);②camelCase JSON 数组 [{"kiroApiKey":"...","region":"..."}];③CLIProxyAPI 导出格式(snake_case kiro_api_key/auth_method/api_region 等,通过 serde alias 兼容),并自动跳过 typekiro 的条目。

修复

  • 导入校验放宽以支持 api_key — 导入项有效性判定从「必须含 refreshToken」放宽为「含 refreshToken 或 kiroApiKey」,无效提示同步更新。
  • TokenJsonItem / NestedCredentials 补齐 snake_case 别名 — 为 refreshToken/clientId/clientSecret/authMethod/apiRegion/profileArn/tokenEndpoint/issuerUrl 等字段补充 #[serde(alias)],使 CLIProxyAPI 的 snake_case 导出可被直接解析。

English Changelog

Added

  • Bulk import of api_key credentials — reuses the existing /api/admin/credentials/import-token-json endpoint (no new route) with a new api_key branch: when there's no refreshToken, the kiroApiKey is stored as the credential with authMethod=api_key, profileArn resolution skipped, and it never enters the refresh path. Before persisting, the key is validated live against the usage-limits endpoint — an invalid key (403) is rejected outright, so no dead credentials are stored. Dedup is by full kiroApiKey string.
  • Three api_key import input formats — the import dialog accepts: (1) plain text, one API key per line (non-JSON input is split on newlines; # starts a comment); (2) a camelCase JSON array [{"kiroApiKey":"...","region":"..."}]; (3) CLIProxyAPI export format (snake_case kiro_api_key/auth_method/api_region, handled via serde aliases), automatically skipping entries whose type is not kiro.

Fixed

  • Relaxed import validation for api_key — an import item is now considered valid if it has a refreshToken or a kiroApiKey (previously refreshToken was mandatory); the invalid-item message was updated accordingly.
  • Added snake_case aliases to TokenJsonItem / NestedCredentials#[serde(alias)] on refreshToken/clientId/clientSecret/authMethod/apiRegion/profileArn/tokenEndpoint/issuerUrl so CLIProxyAPI's snake_case export parses directly.