feat: updated kms service to return only kms details and some more minor changes

This commit is contained in:
=
2024-07-30 23:19:06 +05:30
parent f7ef86eb11
commit 3e0ae5765f
11 changed files with 200 additions and 142 deletions
+4 -2
View File
@@ -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;
+5
View File
@@ -29,6 +29,11 @@ export type KmsListEntry = {
};
};
export enum KmsType {
Internal = "internal",
External = "external"
}
export enum ExternalKmsProvider {
AWS = "aws"
}