mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-17 02:47:35 +00:00
Refactor auth middleware to accept multiple auth modes
This commit is contained in:
@@ -18,7 +18,7 @@ import { serviceTokenDataController } from '../../controllers/v1';
|
||||
router.get(
|
||||
'/',
|
||||
requireAuth({
|
||||
acceptedAuthModes: ['st']
|
||||
acceptedAuthModes: ['serviceToken']
|
||||
}),
|
||||
param('serviceTokenDataId').exists().trim(),
|
||||
validateRequest,
|
||||
|
||||
@@ -11,7 +11,7 @@ import { ADMIN, MEMBER, COMPLETED, GRANTED } from '../../variables';
|
||||
import { membershipController } from '../../controllers/v1';
|
||||
import { workspaceController } from '../../controllers/v2';
|
||||
|
||||
router.post( // unfinished
|
||||
router.post(
|
||||
'/:workspaceId/secrets',
|
||||
requireAuth({
|
||||
acceptedAuthModes: ['jwt']
|
||||
@@ -29,10 +29,10 @@ router.post( // unfinished
|
||||
workspaceController.pushWorkspaceSecrets
|
||||
);
|
||||
|
||||
router.get( // unfinished, check that it works with st
|
||||
router.get(
|
||||
'/:workspaceId/secrets',
|
||||
requireAuth({
|
||||
acceptedAuthModes: ['jwt', 'st']
|
||||
acceptedAuthModes: ['jwt', 'serviceToken']
|
||||
}),
|
||||
requireWorkspaceAuth({
|
||||
acceptedRoles: [ADMIN, MEMBER],
|
||||
|
||||
Reference in New Issue
Block a user