Skip to content

feat(asr): 火山引擎 ASR 新增方舟 API Key 鉴权模式#867

Open
YangLeiSX wants to merge 1 commit into
Open-Less:betafrom
YangLeiSX:feat/volcengine-ark-api-key-auth
Open

feat(asr): 火山引擎 ASR 新增方舟 API Key 鉴权模式#867
YangLeiSX wants to merge 1 commit into
Open-Less:betafrom
YangLeiSX:feat/volcengine-ark-api-key-auth

Conversation

@YangLeiSX

@YangLeiSX YangLeiSX commented Jul 26, 2026

Copy link
Copy Markdown

User description

摘要

Fixes #(暂无对应 issue,新功能)

为火山引擎 ASR 新增方舟(Ark)API Key 鉴权模式,支持新版语音模型控制台的单 API Key 接入,无需再找 APP ID。

修复 / 新增 / 改进

  • 新增 VolcengineAuthMode 枚举(AppIdToken / ApiKey),在同一 provider 内支持两种鉴权模式
  • 旧版 AppIdToken 模式:X-Api-App-Key + X-Api-Access-Key 双表头,端点 /api/v3/sauc/bigmodel_async
  • 新版 ApiKey 模式:X-Api-Key 单表头,端点 /api/v3/plan/sauc/bigmodel_async
  • 二进制帧协议、结果解析、speaker filter、热词注入全部复用,协议层零改动
  • 设置页新增鉴权模式下拉切换,动态显示/隐藏 APP ID 输入框
  • 覆盖 5 种语言 i18n(zh-CN / zh-TW / en / ja / ko)

兼容

  • 不包含:破坏性变更
  • 对现有用户 / 本地环境 / 构建流程的影响:
    • 旧用户 auth_mode 为空时默认回退到 AppIdToken 模式,行为与之前完全一致
    • 无新增依赖,构建流程不变

测试计划

  • 命令:cargo check
  • 结果:编译通过
  • 真机测试:方舟 API Key 模式 WebSocket 连接成功,流式识别正常,首字延迟 ~120ms
  • 真机测试:AppIdToken 模式默认回退正确,旧配置可正常使用
  • 真机测试:设置页鉴权模式切换后重启应用配置保留
  • 真机测试:概览页凭据状态检测对两种模式均正确
  • 证据路径:
粘贴图片_ms213kur_5d1cfe24

PR Type

Enhancement, Tests, Documentation


Description

  • Add VolcengineAuthMode enum supporting AppIdToken and ApiKey modes.

  • Implement dual endpoints, dynamic auth headers, and credential validation.

  • Update settings UI with auth mode dropdown and conditional fields.

  • Add i18n translations for 5 languages.


File Walkthrough

Relevant files
Enhancement
6 files
volcengine.rs
Add VolcengineAuthMode enum and dual endpoint support       
+80/-16 
credentials.rs
Add auth_mode credential account and status check               
+15/-3   
coordinator.rs
Read volcengine auth_mode from credentials                             
+7/-0     
asr_wiring.rs
Validate credentials based on auth mode                                   
+17/-3   
credentials.rs
Add authMode persistence field and account enum                   
+13/-0   
ProvidersSection.tsx
Add auth mode select UI and dynamic field rendering           
+45/-11 
Tests
1 files
mod.rs
Update credentials snapshot test for auth_mode                     
+1/-0     
Documentation
5 files
en.ts
Add English i18n for auth mode                                                     
+5/-0     
ja.ts
Add Japanese i18n for auth mode                                                   
+5/-0     
ko.ts
Add Korean i18n for auth mode                                                       
+5/-0     
zh-CN.ts
Add Chinese Simplified i18n for auth mode                               
+5/-0     
zh-TW.ts
Add Chinese Traditional i18n for auth mode                             
+5/-0     

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant