← 返回列表
D

dsh-oauth-newapi

v0.1.3 · 3 天前发布

New API OAuth provider, account configuration, model discovery, and model adapter for DeepSeek Harness

deepseek-harnessdsh-pluginnew-apioauthoidcmodel-provider

README

dsh-oauth-newapi

面向 DeepSeek Harness 的 New API OAuth 提供方插件。它依赖 dsh-oauth 保存 OAuth 凭据,自己负责站点实例、账号选择、分组、令牌、模型发现和模型路由。

配置

yaml
  • id: llm-newapi-oauth

  • name: dsh-oauth-newapi
    config:
    instances:
    - id: company
    displayName: Company New API
    issuer: https://newapi.example.com

    Cordis 配置中的实例是只读预置。用户界面创建的实例保存在 $DSH_HOME/oauth/newapi.json;相同 ID 下预置实例优先。
    New API 会通过 discovery 公布站点的唯一公开 DSH 客户端,普通配置只需站点地址。旧站点或特殊部署可在高级设置中覆盖 clientIdredirectUri;回调地址必须与 OAuth 应用登记值完全一致,并使用当前机器可监听的固定 loopback 端口。

    协议约定

  • OAuth:Authorization Code + PKCE S256,仅公开客户端。

  • scopes:openid profile offline_access newapi:groups.read newapi:tokens.read newapi:tokens.create newapi:inference

  • 推理鉴权:Authorization: Bearer <OAuth access token>New-Api-Token-Id: <token id>
  • 版本兼容矩阵

    DSH 版本状态说明
    dsh@0.1.0-rc.6 ✅ 兼容 cordis patch ✅
    dsh@0.1.0 ✅ 兼容 标准 patch ✅
    dsh@0.2.0 ⚠️ 待验证 待实测(API 可能在变)
    dsh@0.3.0+ ❓ 未知 尚未发布

    💡 兼容矩阵每周末自动跑实测,欢迎 PR 修正

    元数据

    License
    MIT
    npm
    dsh-oauth-newapi
    Repo
    Engines
    {"node":"^22.19.0 || >=24.0.0"}
    Weekly DL
    0
    Monthly DL
    0
    dsh.bundle
    {"plugin":{"schemaVersion":1,"displayName":{"zh-CN":"New API OAuth 提供方","en":"New API OAuth Provider"},"summary":{"zh-CN":"通过 OAuth 登录兼容的 New API 站点,选择分组、令牌和模型并注册模型路由。","en":"Sign in to compatible New API sites, select a group, token, and models, then register model routes."},"category":"model-provider"},"bundle":{"patch":"./cordis.patch.yml"},"client":{"platform":"web","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-slots","@deepseek-ai/dsh-api-gateway"]}}