mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 13:01:56 +00:00
feat(m365): add the new provider m365 - UI part (#7591)
This commit is contained in:
+12
-1
@@ -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
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user