mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-17 04:33:01 +00:00
Refactor auth middleware to accept multiple auth modes
This commit is contained in:
@@ -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