mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-13 19:29:54 +00:00
Move MI endpoints from v3 to v1
This commit is contained in:
@@ -18,7 +18,7 @@ export const useCreateMachineIdentity = () => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation<CreateMachineIdentityRes, {}, CreateMachineIdentityDTO>({
|
||||
mutationFn: async (body) => {
|
||||
const { data } = await apiRequest.post("/api/v3/machines/", body);
|
||||
const { data } = await apiRequest.post("/api/v1/machine-identities/", body);
|
||||
return data;
|
||||
},
|
||||
onSuccess: ({ machineIdentity }) => {
|
||||
@@ -37,7 +37,7 @@ export const useCreateMachineIdentityClientSecret = () => {
|
||||
usageLimit
|
||||
}) => {
|
||||
|
||||
const { data } = await apiRequest.post(`/api/v3/machines/${machineId}/client-secrets`, {
|
||||
const { data } = await apiRequest.post(`/api/v1/machine-identities/${machineId}/client-secrets`, {
|
||||
machineId,
|
||||
description,
|
||||
ttl,
|
||||
@@ -62,7 +62,7 @@ export const useDeleteMachineIdentityClientSecret = () => {
|
||||
machineId:string;
|
||||
clientSecretId: string;
|
||||
}) => {
|
||||
const { data } = await apiRequest.delete(`/api/v3/machines/${machineId}/client-secrets/${clientSecretId}`);
|
||||
const { data } = await apiRequest.delete(`/api/v1/machine-identities/${machineId}/client-secrets/${clientSecretId}`);
|
||||
return data;
|
||||
},
|
||||
onSuccess: (_, { machineId }) => {
|
||||
@@ -83,7 +83,7 @@ export const useUpdateMachineIdentity = () => {
|
||||
accessTokenTTL
|
||||
}) => {
|
||||
|
||||
const { data: { machineIdentity } } = await apiRequest.patch(`/api/v3/machines/${machineId}`, {
|
||||
const { data: { machineIdentity } } = await apiRequest.patch(`/api/v1/machine-identities/${machineId}`, {
|
||||
name,
|
||||
role,
|
||||
clientSecretTrustedIps,
|
||||
@@ -105,7 +105,7 @@ export const useDeleteMachineIdentity = () => {
|
||||
mutationFn: async ({
|
||||
machineId
|
||||
}) => {
|
||||
const { data: { machineIdentity } } = await apiRequest.delete(`/api/v3/machines/${machineId}`);
|
||||
const { data: { machineIdentity } } = await apiRequest.delete(`/api/v1/machine-identities/${machineId}`);
|
||||
return machineIdentity;
|
||||
},
|
||||
onSuccess: ({ organization }) => {
|
||||
|
||||
@@ -14,8 +14,10 @@ export const useGetMachineIdentityClientSecrets = (machineId: string) => {
|
||||
return useQuery({
|
||||
queryKey: machineIdentityKeys.getMachineIdentityClientSecrets(machineId),
|
||||
queryFn: async () => {
|
||||
if (machineId === "") return [];
|
||||
|
||||
const { data: { clientSecretData } } = await apiRequest.get<{ clientSecretData: MachineIdentityClientSecret[] }>(
|
||||
`/api/v3/machines/${machineId}/client-secrets`
|
||||
`/api/v1/machine-identities/${machineId}/client-secrets`
|
||||
);
|
||||
|
||||
return clientSecretData;
|
||||
|
||||
@@ -20,7 +20,7 @@ export const MembersPage = withPermission(
|
||||
<div className="container mx-auto flex flex-col justify-between bg-bunker-800 text-white">
|
||||
<div className="mb-6 w-full py-6 px-6 max-w-7xl mx-auto">
|
||||
<p className="mr-4 mb-4 text-3xl font-semibold text-white">
|
||||
Access Control
|
||||
Organization Access Control
|
||||
</p>
|
||||
<Tabs defaultValue={TabSections.Member}>
|
||||
<TabList>
|
||||
|
||||
+1
-1
@@ -244,7 +244,7 @@ export const CreateClientSecretModal = ({
|
||||
<div className="flex">
|
||||
<Input
|
||||
{...field}
|
||||
placeholder="7200"
|
||||
placeholder="0"
|
||||
type="number"
|
||||
min="0"
|
||||
step="1"
|
||||
|
||||
@@ -25,7 +25,7 @@ export const MembersPage = withProjectPermission(
|
||||
<div className="container mx-auto flex flex-col justify-between bg-bunker-800 text-white">
|
||||
<div className="mb-6 w-full py-6 px-6 max-w-7xl mx-auto">
|
||||
<p className="mr-4 mb-4 text-3xl font-semibold text-white">
|
||||
Access Control
|
||||
Project Access Control
|
||||
</p>
|
||||
<Tabs defaultValue={TabSections.Member}>
|
||||
<TabList>
|
||||
|
||||
Reference in New Issue
Block a user