feat: 将所有中间件名称从'admin-auth'更新为'auth-admin',以统一认证方式

This commit is contained in:
2026-03-06 02:45:29 +08:00
parent 327db1e09a
commit a563f3e0d6
14 changed files with 27 additions and 27 deletions

View File

@@ -6,7 +6,7 @@ app.route({
path: 'call',
key: '',
description: '调用',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({

View File

@@ -7,7 +7,7 @@ app.route({
path: 'cnb',
key: 'user-check',
description: '检查用户登录状态参数checkToken,default true; checkCookie, default false',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({

View File

@@ -6,7 +6,7 @@ app.route({
path: 'cnb',
key: 'set-cnb-cookie',
description: '设置当前cnb工作空间的cookie环境变量',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({
@@ -33,7 +33,7 @@ app.route({
path: 'cnb',
key: 'get-cnb-cookie',
description: '获取当前cnb工作空间的cookie环境变量',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({

View File

@@ -11,7 +11,7 @@ app.route({
path: 'cnb',
key: 'get-cnb-port-uri',
description: '获取当前cnb工作空间的port代理uri',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({
@@ -40,7 +40,7 @@ app.route({
path: 'cnb',
key: 'get-cnb-vscode-uri',
description: '获取当前cnb工作空间的vscode代理uri, 包括多种访问方式, 如web、vscode、codebuddy、cursor、ssh',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({

View File

@@ -37,8 +37,8 @@ app.route({
}).addTo(app, { overwrite: false });
app.route({
id: 'admin-auth',
path: 'admin-auth',
id: 'auth-admin',
path: 'auth-admin',
middleware: ['auth'],
}).define(async (ctx) => {
// ctx.body = 'Admin Auth Route';

View File

@@ -7,7 +7,7 @@ app.route({
path: 'cnb',
key: 'create-issue',
description: '创建 Issue, 参数 repo, title, body, assignees, labels, priority',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({
@@ -51,7 +51,7 @@ app.route({
path: 'cnb',
key: 'complete-issue',
description: '完成 Issue, 参数 repo, issueNumber',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({

View File

@@ -7,7 +7,7 @@ app.route({
path: 'cnb',
key: 'list-issues',
description: '查询 Issue 列表, 参数 repo, state, keyword, labels, page, page_size 等',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({

View File

@@ -13,7 +13,7 @@ app.route({
path: 'cnb',
key: 'cnb-ai-chat',
description: '调用cnb的知识库ai对话功能进行聊天',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({
@@ -89,7 +89,7 @@ app.route({
path: 'cnb',
key: 'cnb-rag-query',
description: '调用cnb的知识库RAG查询功能进行问答',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({

View File

@@ -7,7 +7,7 @@ app.route({
path: 'cnb',
key: 'list-repos',
description: '列出我的代码仓库',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({

View File

@@ -6,7 +6,7 @@ app.route({
path: 'cnb',
key: 'create-repo',
description: '创建代码仓库, 参数name, visibility, description',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({
@@ -46,7 +46,7 @@ app.route({
path: 'cnb',
key: 'create-repo-file',
description: '在代码仓库中创建文件, repoName, filePath, content, encoding。使用CNB_COOKIE进行鉴权',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({
@@ -85,7 +85,7 @@ app.route({
path: 'cnb',
key: 'delete-repo',
description: '删除代码仓库, 参数name',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({

View File

@@ -9,7 +9,7 @@ app.route({
path: 'cnb',
key: 'start-workspace',
description: '启动开发工作空间, 参数 repo',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({
@@ -42,7 +42,7 @@ app.route({
path: 'cnb',
key: 'list-workspace',
description: '获取cnb开发工作空间列表可选参数 status=running 获取运行中的环境',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({
@@ -73,7 +73,7 @@ app.route({
path: 'cnb',
key: 'get-workspace',
description: '获取工作空间详情,通过 repo 和 sn 获取',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({
@@ -104,7 +104,7 @@ app.route({
path: 'cnb',
key: 'delete-workspace',
description: '删除工作空间,通过 pipelineId 或 sn',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({
@@ -143,7 +143,7 @@ app.route({
path: 'cnb',
key: 'stop-workspace',
description: '停止工作空间,通过 pipelineId 或 sn',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({

View File

@@ -8,7 +8,7 @@ app.route({
path: 'cnb',
key: 'keep-workspace-alive',
description: '保持工作空间存活技能参数repo:代码仓库路径,例如 user/repopipelineId:流水线ID例如 cnb-708-1ji9sog7o-001',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: [],
...({
@@ -52,7 +52,7 @@ app.route({
path: 'cnb',
key: 'stop-keep-workspace-alive',
description: '停止保持工作空间存活技能, 参数repo:代码仓库路径,例如 user/repopipelineId:流水线ID例如 cnb-708-1ji9sog7o-001',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: [],
...({
@@ -80,7 +80,7 @@ app.route({
path: 'cnb',
key: 'keep-alive-current-workspace',
description: '保持当前工作空间存活技能',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
skill: 'keep-alive-current-workspace',

View File

@@ -35,7 +35,7 @@ app.route({
path: 'cnb',
key: 'clean-closed-workspace',
description: '批量删除已停止的cnb工作空间',
middleware: ['admin-auth'],
middleware: ['auth-admin'],
metadata: {
tags: ['opencode'],
...createSkill({

View File

@@ -1,6 +1,6 @@
{
"name": "@kevisual/cnb",
"version": "0.0.34",
"version": "0.0.35",
"description": "",
"main": "index.js",
"scripts": {