diff --git a/actions/providers/providers.ts b/actions/providers/providers.ts index f0fe26b0d5..58975d7987 100644 --- a/actions/providers/providers.ts +++ b/actions/providers/providers.ts @@ -172,6 +172,12 @@ export const addCredentialsProvider = async (formData: FormData) => { client_secret: formData.get("client_secret"), tenant_id: formData.get("tenant_id"), }; + } else if (providerType === "gcp") { + secret = { + client_id: formData.get("client_id"), + client_secret: formData.get("client_secret"), + refresh_token: formData.get("refresh_token"), + }; } const bodyData = { diff --git a/components/providers/workflow/forms/via-credentials-form.tsx b/components/providers/workflow/forms/via-credentials-form.tsx index c406e0574a..105962c53c 100644 --- a/components/providers/workflow/forms/via-credentials-form.tsx +++ b/components/providers/workflow/forms/via-credentials-form.tsx @@ -10,11 +10,17 @@ import { addCredentialsProvider } from "@/actions/providers/providers"; import { useToast } from "@/components/ui"; import { CustomButton, CustomInput } from "@/components/ui/custom"; import { Form } from "@/components/ui/form"; -import { addCredentialsFormSchema, ApiError, AzureCredentials } from "@/types"; -import { AWSCredentials } from "@/types"; +import { + addCredentialsFormSchema, + ApiError, + AWSCredentials, + AzureCredentials, + GCPCredentials, +} from "@/types"; import { AWScredentialsForm } from "./via-credentials/aws-credentials-form"; import { AzureCredentialsForm } from "./via-credentials/azure-credentials-form"; +import { GCPcredentialsForm } from "./via-credentials/gcp-credentials-form"; type CredentialsFormSchema = z.infer< ReturnType @@ -153,6 +159,11 @@ export const ViaCredentialsForm = ({ control={form.control as unknown as Control} /> )} + {providerType === "gcp" && ( + } + /> + )} Name (Optional) ; +}) => { + return ( + <> +
+
+ Connect via Credentials +
+
+ Please provide the information for your GCP credentials. +
+
+ + + + + ); +}; diff --git a/components/providers/workflow/forms/via-credentials/index.ts b/components/providers/workflow/forms/via-credentials/index.ts index 4286cf7741..8ae3137774 100644 --- a/components/providers/workflow/forms/via-credentials/index.ts +++ b/components/providers/workflow/forms/via-credentials/index.ts @@ -1,2 +1,3 @@ export * from "./aws-credentials-form"; export * from "./azure-credentials-form"; +export * from "./gcp-credentials-form";