mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 21:40:31 +00:00
feat: updated kms service to return only kms details and some more minor changes
This commit is contained in:
@@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { apiRequest } from "@app/config/request";
|
||||
|
||||
import { kmsKeys } from "./queries";
|
||||
import { AddExternalKmsType } from "./types";
|
||||
import { AddExternalKmsType, KmsType } from "./types";
|
||||
|
||||
export const useAddExternalKms = (orgId: string) => {
|
||||
const queryClient = useQueryClient();
|
||||
@@ -66,7 +66,9 @@ export const useRemoveExternalKms = (orgId: string) => {
|
||||
export const useUpdateProjectKms = (projectId: string) => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: async (updatedData: { secretManagerKmsKeyId: string }) => {
|
||||
mutationFn: async (
|
||||
updatedData: { type: KmsType.Internal } | { type: KmsType.External; kmsId: string }
|
||||
) => {
|
||||
const { data } = await apiRequest.patch(`/api/v1/workspace/${projectId}/kms`, updatedData);
|
||||
|
||||
return data;
|
||||
|
||||
@@ -29,6 +29,11 @@ export type KmsListEntry = {
|
||||
};
|
||||
};
|
||||
|
||||
export enum KmsType {
|
||||
Internal = "internal",
|
||||
External = "external"
|
||||
}
|
||||
|
||||
export enum ExternalKmsProvider {
|
||||
AWS = "aws"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user