feat(cli): add shumai-cli and token authentication

This commit is contained in:
yiling
2026-06-21 12:35:12 +08:00
parent e33cbdb37c
commit 90ef063d43
40 changed files with 3609 additions and 18 deletions
+9
View File
@@ -9,6 +9,7 @@ import folderRoute from './folder'
import inviteRoute from './invite'
import metadataRoute from './metadata'
import { authMiddleware } from './middleware/auth'
import { tokenAuthMiddleware } from './middleware/tokenAuth'
import notificationRoute from './notification'
import projectRoute from './project'
import providerRoute from './provider'
@@ -31,6 +32,14 @@ const apiRoute = new Hono<{ Variables: { user: User } }>()
.route('/', publicInviteRoute)
.route('/', publicShareRoute)
// Selected routes supporting API token authentication
.use('/projects', tokenAuthMiddleware)
.use('/projects/*', tokenAuthMiddleware)
.use('/folders', tokenAuthMiddleware)
.use('/folders/*', tokenAuthMiddleware)
.use('/teams/:teamId/upload/tasks', tokenAuthMiddleware)
.use('/teams/:teamId/upload/tasks/*', tokenAuthMiddleware)
// Protected Routes
.use('*', authMiddleware)
.route('/', inviteRoute)