mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 05:19:49 +00:00
Move MI endpoints from v3 to v1
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import * as machineIdentitiesController from "./machineIdentitiesController";
|
||||
import * as secretController from "./secretController";
|
||||
import * as secretSnapshotController from "./secretSnapshotController";
|
||||
import * as organizationsController from "./organizationsController";
|
||||
@@ -13,6 +14,7 @@ import * as secretRotationProviderController from "./secretRotationProviderContr
|
||||
import * as secretRotationController from "./secretRotationController";
|
||||
|
||||
export {
|
||||
machineIdentitiesController,
|
||||
secretController,
|
||||
secretSnapshotController,
|
||||
organizationsController,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import * as machineIdentityController from "./machineIdentityController";
|
||||
import * as apiKeyDataController from "./apiKeyDataController";
|
||||
|
||||
export {
|
||||
machineIdentityController,
|
||||
apiKeyDataController
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import machineIdentities from "./machineIdentities";
|
||||
import secret from "./secret";
|
||||
import secretSnapshot from "./secretSnapshot";
|
||||
import organizations from "./organizations";
|
||||
@@ -13,6 +14,7 @@ import secretRotationProvider from "./secretRotationProvider";
|
||||
import secretRotation from "./secretRotation";
|
||||
|
||||
export {
|
||||
machineIdentities,
|
||||
secret,
|
||||
secretSnapshot,
|
||||
organizations,
|
||||
|
||||
+8
-9
@@ -2,14 +2,14 @@ import express from "express";
|
||||
const router = express.Router();
|
||||
import { requireAuth } from "../../../middleware";
|
||||
import { AuthMode } from "../../../variables";
|
||||
import { machineIdentityController } from "../../controllers/v3";
|
||||
import { machineIdentitiesController } from "../../controllers/v1";
|
||||
|
||||
router.get(
|
||||
"/:machineId/client-secrets",
|
||||
requireAuth({
|
||||
acceptedAuthModes: [AuthMode.JWT]
|
||||
}),
|
||||
machineIdentityController.getMIClientSecrets
|
||||
machineIdentitiesController.getMIClientSecrets
|
||||
);
|
||||
|
||||
router.post(
|
||||
@@ -17,7 +17,7 @@ router.post(
|
||||
requireAuth({
|
||||
acceptedAuthModes: [AuthMode.JWT]
|
||||
}),
|
||||
machineIdentityController.createMIClientSecret
|
||||
machineIdentitiesController.createMIClientSecret
|
||||
);
|
||||
|
||||
router.delete(
|
||||
@@ -25,13 +25,12 @@ router.delete(
|
||||
requireAuth({
|
||||
acceptedAuthModes: [AuthMode.JWT]
|
||||
}),
|
||||
machineIdentityController.deleteMIClientSecret
|
||||
machineIdentitiesController.deleteMIClientSecret
|
||||
);
|
||||
|
||||
// consider moving to /auth/machine/login
|
||||
router.post(
|
||||
"/login",
|
||||
machineIdentityController.loginMI
|
||||
machineIdentitiesController.loginMI
|
||||
);
|
||||
|
||||
router.post(
|
||||
@@ -39,7 +38,7 @@ router.post(
|
||||
requireAuth({
|
||||
acceptedAuthModes: [AuthMode.JWT, AuthMode.MACHINE_ACCESS_TOKEN]
|
||||
}),
|
||||
machineIdentityController.createMachineIdentity
|
||||
machineIdentitiesController.createMachineIdentity
|
||||
);
|
||||
|
||||
router.patch(
|
||||
@@ -47,7 +46,7 @@ router.patch(
|
||||
requireAuth({
|
||||
acceptedAuthModes: [AuthMode.JWT]
|
||||
}),
|
||||
machineIdentityController.updateMachineIdentity
|
||||
machineIdentitiesController.updateMachineIdentity
|
||||
);
|
||||
|
||||
router.delete(
|
||||
@@ -55,7 +54,7 @@ router.delete(
|
||||
requireAuth({
|
||||
acceptedAuthModes: [AuthMode.JWT]
|
||||
}),
|
||||
machineIdentityController.deleteMachineIdentity
|
||||
machineIdentitiesController.deleteMachineIdentity
|
||||
);
|
||||
|
||||
export default router;
|
||||
@@ -1,7 +1,5 @@
|
||||
import machineIdentity from "./machineIdentity";
|
||||
import apiKeyData from "./apiKeyData";
|
||||
|
||||
export {
|
||||
machineIdentity,
|
||||
apiKeyData
|
||||
}
|
||||
@@ -362,7 +362,7 @@ export const getAuthDataProjectPermissions = async ({
|
||||
}
|
||||
}
|
||||
|
||||
export const getRolePermissions = async (role: string, workspaceId: string) => {
|
||||
export const getWorkspaceRolePermissions = async (role: string, workspaceId: string) => {
|
||||
const isCustomRole = ![ADMIN, MEMBER, VIEWER, NO_ACCESS].includes(role);
|
||||
if (isCustomRole) {
|
||||
const workspaceRole = await Role.findOne({
|
||||
|
||||
Reference in New Issue
Block a user