Begin rewiring frontend to use batch route for CRUD secret ops

This commit is contained in:
Tuan Dang
2023-02-16 22:43:53 +07:00
parent da857f321b
commit 65bec23292
7 changed files with 413 additions and 28 deletions
+18
View File
@@ -15,6 +15,24 @@ import {
SECRET_SHARED
} from '../../variables';
// TODO: create batch update endpoint
router.post(
'/batch',
body('workspaceId').exists().isString().trim(),
body('environment').exists().isString().trim(),
body('requests').exists(), // perform validation for batch requests
validateRequest,
requireAuth({
acceptedAuthModes: ['jwt', 'apiKey']
}),
requireWorkspaceAuth({
acceptedRoles: [ADMIN, MEMBER],
location: 'body'
}),
secretsController.batchSecrets
)
router.post(
'/',
body('workspaceId').exists().isString().trim(),