feat: Add dynamic secrets for Azure Entra ID

This commit is contained in:
Meet
2024-09-17 10:29:19 +05:30
parent a6f4a95821
commit b3f0d36ddc
14 changed files with 664 additions and 10 deletions
@@ -6,6 +6,7 @@ import { apiRequest } from "@app/config/request";
import {
TDetailsDynamicSecretDTO,
TDynamicSecret,
TDynamicSecretProvider,
TGetDynamicSecretsByEnvsDTO,
TListDynamicSecretDTO
} from "./types";
@@ -71,6 +72,28 @@ export const useGetDynamicSecretDetails = ({
});
};
export const useGetDynamicSecretProviderData = ({
provider,
dataFetchType
}: {
provider: TDynamicSecretProvider,
dataFetchType: "Users"
}) => {
return useQuery({
queryKey: ["users"],
queryFn: async () => {
const { data } = await apiRequest.post<{ data: { users: [{ name: string, id: string }] } }>(
"/api/v1/dynamic-secrets/fetch-provider-data",
{
provider,
dataFetchType
}
);
return data.data.users;
}
});
};
export const useGetDynamicSecretsOfAllEnv = ({
path,
projectSlug,
+10 -2
View File
@@ -24,7 +24,8 @@ export enum DynamicSecretProviders {
MongoAtlas = "mongo-db-atlas",
ElasticSearch = "elastic-search",
MongoDB = "mongo-db",
RabbitMq = "rabbit-mq"
RabbitMq = "rabbit-mq",
AzureEntraId = "azure-entra-id"
}
export enum SqlProviders {
@@ -177,7 +178,14 @@ export type TDynamicSecretProvider =
};
ca?: string;
};
};
}
| {
type: DynamicSecretProviders.AzureEntraId;
inputs: {
tenantId: string;
userId: string;
};
};
export type TCreateDynamicSecretDTO = {
projectSlug: string;