feat: enhance API key management and fix routing logic
* ``` feat(accounts): 支持批量添加API密钥连接 - 添加accessTokens字段到账户创建载荷模式,允许传递多个API密钥 - 实现批量API密钥解析功能,支持换行符、空格和逗号分隔 - 重构账户创建逻辑以支持单个和批量API密钥处理 - 在前端界面中添加批量API密钥输入检测和处理 - 添加批量创建结果返回和错误处理 - 更新验证流程以支持批量模式下的逐条验证 - 添加详细的批量API密钥测试用例 该更改允许用户一次提交多个API密钥,系统将为每个密钥创建独立的连接并参与负载均衡。 ``` * ``` fix(tokenRouter): 调整路由匹配优先级以优先匹配显示名称别名 当精确路由和显式组显示名称冲突时,现在优先选择显式组显示名称 而不是精确路由模式。这修正了路由决策逻辑,使显式组路由能够正 确覆盖精确模型匹配。 相关的测试用例已更新以反映新的匹配行为,确保显式组路由在冲 突情况下获得更高优先级。 ``` * ``` fix(accounts): 修复API密钥验证错误消息显示逻辑 当凭证模式不为apikey时显示会话令牌提示信息,否则显示API密钥验证失败信息 feat(accounts): 更新API密钥输入界面提示文本 将批量添加说明从输入框占位符移至独立提示文本, 使界面更清晰易懂 ``` * ``` feat(workflow): 在CI/CD工作流中使用动态Docker Hub镜像名称 - 在ci.yml和release.yml工作流中添加DOCKERHUB_IMAGE环境变量 - 将硬编码的Docker Hub用户名替换为从secrets.DOCKERHUB_USERNAME动态获取 - 更新docker.metadata-action配置以使用环境变量中的镜像名称 - 添加测试用例验证Docker Hub镜像名称的正确配置 ``` * fix(accounts): 修复批量创建回归并下沉创建流程
This commit is contained in:
@@ -342,6 +342,8 @@ jobs:
|
||||
if: github.event_name == 'push'
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 45
|
||||
env:
|
||||
DOCKERHUB_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/metapi
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -384,7 +386,7 @@ jobs:
|
||||
id: meta
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: 1467078763/metapi
|
||||
images: ${{ env.DOCKERHUB_IMAGE }}
|
||||
tags: |
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=ref,event=branch
|
||||
@@ -424,6 +426,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: publish-docker-arch
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
DOCKERHUB_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/metapi
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -449,7 +453,7 @@ jobs:
|
||||
id: meta
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: 1467078763/metapi
|
||||
images: ${{ env.DOCKERHUB_IMAGE }}
|
||||
tags: |
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=ref,event=branch
|
||||
|
||||
@@ -283,14 +283,16 @@ jobs:
|
||||
generate_release_notes: true
|
||||
files: release-assets/*
|
||||
|
||||
publish-docker-arch:
|
||||
name: Publish Docker Image (${{ matrix.arch }})
|
||||
needs: build-packages
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 45
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
strategy:
|
||||
fail-fast: false
|
||||
publish-docker-arch:
|
||||
name: Publish Docker Image (${{ matrix.arch }})
|
||||
needs: build-packages
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 45
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
DOCKERHUB_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/metapi
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: amd64
|
||||
@@ -334,16 +336,16 @@ jobs:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: |
|
||||
1467078763/metapi
|
||||
ghcr.io/${{ github.repository }}
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=raw,value=latest
|
||||
- name: Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: |
|
||||
${{ env.DOCKERHUB_IMAGE }}
|
||||
ghcr.io/${{ github.repository }}
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=raw,value=latest
|
||||
|
||||
- name: Add architecture suffix to tags
|
||||
id: arch-tags
|
||||
@@ -373,14 +375,16 @@ jobs:
|
||||
cache-from: type=gha,scope=release-${{ matrix.arch }}
|
||||
cache-to: type=gha,mode=max,scope=release-${{ matrix.arch }}
|
||||
|
||||
publish-docker:
|
||||
name: Publish Docker Manifests
|
||||
needs: publish-docker-arch
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
||||
steps:
|
||||
publish-docker:
|
||||
name: Publish Docker Manifests
|
||||
needs: publish-docker-arch
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
DOCKERHUB_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/metapi
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
@@ -407,16 +411,16 @@ jobs:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: |
|
||||
1467078763/metapi
|
||||
ghcr.io/${{ github.repository }}
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=raw,value=latest
|
||||
- name: Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: |
|
||||
${{ env.DOCKERHUB_IMAGE }}
|
||||
ghcr.io/${{ github.repository }}
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=raw,value=latest
|
||||
|
||||
- name: Create multi-arch manifests
|
||||
shell: bash
|
||||
|
||||
Reference in New Issue
Block a user