mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 18:28:27 +00:00
update delete client secret to revoke client secret
This commit is contained in:
@@ -101,7 +101,8 @@ export const getMIClientSecrets = async (req: Request, res: Response) => {
|
|||||||
|
|
||||||
const clientSecretData = await MachineIdentityClientSecret
|
const clientSecretData = await MachineIdentityClientSecret
|
||||||
.find({
|
.find({
|
||||||
machineIdentity: machineMembershipOrg.machineIdentity
|
machineIdentity: machineMembershipOrg.machineIdentity,
|
||||||
|
isClientSecretRevoked: false
|
||||||
})
|
})
|
||||||
.sort({ createdAt: -1 })
|
.sort({ createdAt: -1 })
|
||||||
.limit(5);
|
.limit(5);
|
||||||
@@ -209,7 +210,7 @@ export const createMIClientSecret = async (req: Request, res: Response) => {
|
|||||||
* @param req
|
* @param req
|
||||||
* @param res
|
* @param res
|
||||||
*/
|
*/
|
||||||
export const deleteMIClientSecret = async (req: Request, res: Response) => {
|
export const revokeMIClientSecret = async (req: Request, res: Response) => {
|
||||||
const {
|
const {
|
||||||
params: {
|
params: {
|
||||||
machineId,
|
machineId,
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ router.post(
|
|||||||
machineIdentitiesController.createMIClientSecret
|
machineIdentitiesController.createMIClientSecret
|
||||||
);
|
);
|
||||||
|
|
||||||
router.delete(
|
router.post(
|
||||||
"/:machineId/client-secrets/:clientSecretId",
|
"/:machineId/client-secrets/:clientSecretId/revoke",
|
||||||
requireAuth({
|
requireAuth({
|
||||||
acceptedAuthModes: [AuthMode.JWT]
|
acceptedAuthModes: [AuthMode.JWT]
|
||||||
}),
|
}),
|
||||||
machineIdentitiesController.deleteMIClientSecret
|
machineIdentitiesController.revokeMIClientSecret
|
||||||
);
|
);
|
||||||
|
|
||||||
router.post(
|
router.post(
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export const useDeleteMachineIdentityClientSecret = () => {
|
|||||||
machineId:string;
|
machineId:string;
|
||||||
clientSecretId: string;
|
clientSecretId: string;
|
||||||
}) => {
|
}) => {
|
||||||
const { data } = await apiRequest.delete(`/api/v1/machine-identities/${machineId}/client-secrets/${clientSecretId}`);
|
const { data } = await apiRequest.post(`/api/v1/machine-identities/${machineId}/client-secrets/${clientSecretId}/revoke`);
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
onSuccess: (_, { machineId }) => {
|
onSuccess: (_, { machineId }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user