feat(m365): add the new provider m365 - UI part (#7591)

This commit is contained in:
Pablo Lara
2025-04-23 14:23:33 +02:00
committed by Pepe Fagoaga
parent 8239e2cd09
commit e2fd3f14ed
17 changed files with 326 additions and 24 deletions
+12 -1
View File
@@ -238,6 +238,16 @@ export type AzureCredentials = {
providerId: string;
};
export type M365Credentials = {
client_id: string;
client_secret: string;
tenant_id: string;
user: string;
encrypted_password: string;
secretName: string;
providerId: string;
};
export type GCPCredentials = {
client_id: string;
client_secret: string;
@@ -256,7 +266,8 @@ export type CredentialsFormSchema =
| AWSCredentials
| AzureCredentials
| GCPCredentials
| KubernetesCredentials;
| KubernetesCredentials
| M365Credentials;
export interface SearchParamsProps {
[key: string]: string | string[] | undefined;
+20 -2
View File
@@ -63,7 +63,7 @@ export const awsCredentialsTypeSchema = z.object({
export const addProviderFormSchema = z
.object({
providerType: z.enum(["aws", "azure", "gcp", "kubernetes"], {
providerType: z.enum(["aws", "azure", "gcp", "kubernetes", "m365"], {
required_error: "Please select a provider type",
}),
})
@@ -80,6 +80,12 @@ export const addProviderFormSchema = z
providerUid: z.string(),
awsCredentialsType: z.string().optional(),
}),
z.object({
providerType: z.literal("m365"),
providerAlias: z.string(),
providerUid: z.string(),
awsCredentialsType: z.string().optional(),
}),
z.object({
providerType: z.literal("gcp"),
providerAlias: z.string(),
@@ -128,7 +134,19 @@ export const addCredentialsFormSchema = (providerType: string) =>
.string()
.nonempty("Kubeconfig Content is required"),
}
: {}),
: providerType === "m365"
? {
client_id: z.string().nonempty("Client ID is required"),
client_secret: z
.string()
.nonempty("Client Secret is required"),
tenant_id: z.string().nonempty("Tenant ID is required"),
user: z.string().nonempty("User is required"),
encrypted_password: z
.string()
.nonempty("Encrypted Password is required"),
}
: {}),
});
export const addCredentialsRoleFormSchema = (providerType: string) =>