feat(server): Add api key handler

This commit is contained in:
maooyer
2026-04-22 20:50:17 +08:00
committed by shuaiplus
parent 7d7562d191
commit 31ffd98166
4 changed files with 176 additions and 0 deletions
+10
View File
@@ -11,6 +11,8 @@ import {
handleGetTotpStatus,
handleSetTotpStatus,
handleGetTotpRecoveryCode,
handleGetApiKey,
handleRotateApiKey,
} from './handlers/accounts';
import {
handleGetCiphers,
@@ -119,6 +121,14 @@ export async function handleAuthenticatedRoute(
return handleSetVerifyDevices(request, env, userId);
}
if (path === '/api/accounts/api_key' && method === 'POST') {
return handleGetApiKey(request, env, userId);
}
if (path === '/api/accounts/rotate_api_key' && method === 'POST') {
return handleRotateApiKey(request, env, userId);
}
if (path === '/api/sync' && method === 'GET') {
return handleSync(request, env, userId);
}