Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
feat: add qovery app connection
adilsonb218c96630fd
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.tsindex cd6cd952db..ce4b1934b7 100644--- a/backend/src/lib/api-docs/constants.ts+++ b/backend/src/lib/api-docs/constants.ts@@ -2881,6 +2881,10 @@ export const AppConnections = {instanceUrl: "The Octopus Deploy instance URL to connect to.",apiKey: "The API key used to authenticate with Octopus Deploy."},+ QOVERY: {+ accessToken: "The project access token used to authenticate with Qovery.",+ instanceUrl: "The Qovery API URL to connect to (defaults to https://api.qovery.com)."+ },DATADOG: {url: "The Datadog site URL to connect to (e.g., 'https://api.datadoghq.com').",apiKey: "The Datadog API key used to authenticate.",diff --git a/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts b/backend/src/server/routes/v1/app-connection-routers/app-connection-router.tsindex 8102bc52ff..0ee12dd852 100644--- a/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts+++ b/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts@@ -163,6 +163,7 @@ import {PostgresConnectionListItemSchema,SanitizedPostgresConnectionSchema} from "@app/services/app-connection/postgres";+import { QoveryConnectionListItemSchema, SanitizedQoveryConnectionSchema } from "@app/services/app-connection/qovery";import {RailwayConnectionListItemSchema,SanitizedRailwayConnectionSchema@@ -286,7 +287,8 @@ const SanitizedAppConnectionSchema = z.union([...SanitizedSnowflakeConnectionSchema.options,...SanitizedDatadogConnectionSchema.options,...SanitizedF5BigIpConnectionSchema.options,- ...SanitizedConvexConnectionSchema.options+ ...SanitizedConvexConnectionSchema.options,+ ...SanitizedQoveryConnectionSchema.options]);const AppConnectionOptionsSchema = z.discriminatedUnion("app", [@@ -359,7 +361,8 @@ const AppConnectionOptionsSchema = z.discriminatedUnion("app", [SnowflakeConnectionListItemSchema,DatadogConnectionListItemSchema,F5BigIpConnectionListItemSchema,- ConvexConnectionListItemSchema+ ConvexConnectionListItemSchema,+ QoveryConnectionListItemSchema]);export const registerAppConnectionRouter = async (server: FastifyZodProvider) => {diff --git a/backend/src/server/routes/v1/app-connection-routers/index.ts b/backend/src/server/routes/v1/app-connection-routers/index.tsindex 861a892ccb..b76fb5c9dd 100644--- a/backend/src/server/routes/v1/app-connection-routers/index.ts+++ b/backend/src/server/routes/v1/app-connection-routers/index.ts@@ -53,6 +53,7 @@ import { registerOnaConnectionRouter } from "./ona-connection-router";import { registerOpenRouterConnectionRouter } from "./open-router-connection-router";import { registerOvhConnectionRouter } from "./ovh-connection-router";import { registerPostgresConnectionRouter } from "./postgres-connection-router";+import { registerQoveryConnectionRouter } from "./qovery-connection-router";import { registerRailwayConnectionRouter } from "./railway-connection-router";import { registerRedisConnectionRouter } from "./redis-connection-router";import { registerRenderConnectionRouter } from "./render-connection-router";@@ -144,5 +145,6 @@ export const APP_CONNECTION_REGISTER_ROUTER_MAP: Record<AppConnection, (server:[AppConnection.Snowflake]: registerSnowflakeConnectionRouter,[AppConnection.Datadog]: registerDatadogConnectionRouter,[AppConnection.F5BigIp]: registerF5BigIpConnectionRouter,- [AppConnection.Convex]: registerConvexConnectionRouter+ [AppConnection.Convex]: registerConvexConnectionRouter,+ [AppConnection.Qovery]: registerQoveryConnectionRouter};diff --git a/backend/src/server/routes/v1/app-connection-routers/qovery-connection-router.ts b/backend/src/server/routes/v1/app-connection-routers/qovery-connection-router.tsnew file mode 100644index 0000000000..2cb39ba2cb--- /dev/null+++ b/backend/src/server/routes/v1/app-connection-routers/qovery-connection-router.ts@@ -0,0 +1,18 @@+import { AppConnection } from "@app/services/app-connection/app-connection-enums";+import {+ CreateQoveryConnectionSchema,+ SanitizedQoveryConnectionSchema,+ UpdateQoveryConnectionSchema+} from "@app/services/app-connection/qovery";++import { registerAppConnectionEndpoints } from "./app-connection-endpoints";++export const registerQoveryConnectionRouter = async (server: FastifyZodProvider) => {+ registerAppConnectionEndpoints({+ app: AppConnection.Qovery,+ server,+ sanitizedResponseSchema: SanitizedQoveryConnectionSchema,+ createSchema: CreateQoveryConnectionSchema,+ updateSchema: UpdateQoveryConnectionSchema+ });+};diff --git a/backend/src/services/app-connection/app-connection-enums.ts b/backend/src/services/app-connection/app-connection-enums.tsindex 2396a9309e..83bbf5b95f 100644--- a/backend/src/services/app-connection/app-connection-enums.ts+++ b/backend/src/services/app-connection/app-connection-enums.ts@@ -68,7 +68,8 @@ export enum AppConnection {Datadog = "datadog",F5BigIp = "f5-big-ip",GoDaddy = "godaddy",- Convex = "convex"+ Convex = "convex",+ Qovery = "qovery"}export enum AWSRegion {diff --git a/backend/src/services/app-connection/app-connection-fns.ts b/backend/src/services/app-connection/app-connection-fns.tsindex 6fdb0ede8c..0362ded729 100644--- a/backend/src/services/app-connection/app-connection-fns.ts+++ b/backend/src/services/app-connection/app-connection-fns.ts@@ -206,6 +206,7 @@ import {} from "./open-router";import { getOvhConnectionListItem, OVHConnectionMethod, validateOvhConnectionCredentials } from "./ovh";import { getPostgresConnectionListItem, PostgresConnectionMethod } from "./postgres";+import { getQoveryConnectionListItem, QoveryConnectionMethod, validateQoveryConnectionCredentials } from "./qovery";import { getRailwayConnectionListItem, validateRailwayConnectionCredentials } from "./railway";import { getRedisConnectionListItem, RedisConnectionMethod, validateRedisConnectionCredentials } from "./redis";import { RenderConnectionMethod } from "./render/render-connection-enums";@@ -363,7 +364,8 @@ export const listAppConnectionOptions = (projectType?: ProjectType) => {getSnowflakeConnectionListItem(),getDatadogConnectionListItem(),getF5BigIpConnectionListItem(),- getConvexConnectionListItem()+ getConvexConnectionListItem(),+ getQoveryConnectionListItem()].filter((option) => {switch (projectType) {@@ -604,7 +606,8 @@ export const validateAppConnectionCredentials = async ([AppConnection.Snowflake]: validateSnowflakeConnectionCredentials as TAppConnectionCredentialsValidator,[AppConnection.Datadog]: validateDatadogConnectionCredentials as TAppConnectionCredentialsValidator,[AppConnection.F5BigIp]: validateF5BigIpConnectionCredentials as TAppConnectionCredentialsValidator,- [AppConnection.Convex]: validateConvexConnectionCredentials as TAppConnectionCredentialsValidator+ [AppConnection.Convex]: validateConvexConnectionCredentials as TAppConnectionCredentialsValidator,+ [AppConnection.Qovery]: validateQoveryConnectionCredentials as TAppConnectionCredentialsValidator};return VALIDATE_APP_CONNECTION_CREDENTIALS_MAP[appConnection.app](appConnection, gatewayService, gatewayV2Service);@@ -704,6 +707,7 @@ export const getAppConnectionMethodName = (method: TAppConnection["method"]) =>return "API Key";case ChefConnectionMethod.UserKey:return "User Key";+ case QoveryConnectionMethod.AccessToken:case SupabaseConnectionMethod.AccessToken:return "Access Token";case NetScalerConnectionMethod.BasicAuth:@@ -847,7 +851,8 @@ export const TRANSITION_CONNECTION_CREDENTIALS_TO_PLATFORM: Record<[AppConnection.Datadog]: platformManagedCredentialsNotSupported,[AppConnection.F5BigIp]: platformManagedCredentialsNotSupported,[AppConnection.GoDaddy]: platformManagedCredentialsNotSupported,- [AppConnection.Convex]: platformManagedCredentialsNotSupported+ [AppConnection.Convex]: platformManagedCredentialsNotSupported,+ [AppConnection.Qovery]: platformManagedCredentialsNotSupported};export const enterpriseAppCheck = async (diff --git a/backend/src/services/app-connection/app-connection-maps.ts b/backend/src/services/app-connection/app-connection-maps.tsindex b265cce9c5..e0b88d03ac 100644--- a/backend/src/services/app-connection/app-connection-maps.ts+++ b/backend/src/services/app-connection/app-connection-maps.ts@@ -70,7 +70,8 @@ export const APP_CONNECTION_NAME_MAP: Record<AppConnection, string> = {[AppConnection.Datadog]: "Datadog",[AppConnection.F5BigIp]: "F5 BIG-IP",[AppConnection.GoDaddy]: "GoDaddy",- [AppConnection.Convex]: "Convex"+ [AppConnection.Convex]: "Convex",+ [AppConnection.Qovery]: "Qovery"};export const APP_CONNECTION_PLAN_MAP: Record<AppConnection, AppConnectionPlanType> = {@@ -143,5 +144,6 @@ export const APP_CONNECTION_PLAN_MAP: Record<AppConnection, AppConnectionPlanTyp[AppConnection.Datadog]: AppConnectionPlanType.Regular,[AppConnection.F5BigIp]: AppConnectionPlanType.Regular,[AppConnection.GoDaddy]: AppConnectionPlanType.Regular,- [AppConnection.Convex]: AppConnectionPlanType.Regular+ [AppConnection.Convex]: AppConnectionPlanType.Regular,+ [AppConnection.Qovery]: AppConnectionPlanType.Regular};diff --git a/backend/src/services/app-connection/app-connection-service.ts b/backend/src/services/app-connection/app-connection-service.tsindex 310db7fce6..84dd4d9d16 100644--- a/backend/src/services/app-connection/app-connection-service.ts+++ b/backend/src/services/app-connection/app-connection-service.ts@@ -143,6 +143,7 @@ import { onaConnectionService } from "./ona/ona-connection-service";import { ValidateOpenRouterConnectionCredentialsSchema } from "./open-router";import { ValidateOvhConnectionCredentialsSchema } from "./ovh";import { ValidatePostgresConnectionCredentialsSchema } from "./postgres";+import { ValidateQoveryConnectionCredentialsSchema } from "./qovery";import { ValidateRailwayConnectionCredentialsSchema } from "./railway";import { railwayConnectionService } from "./railway/railway-connection-service";import { ValidateRedisConnectionCredentialsSchema } from "./redis";@@ -266,7 +267,8 @@ const VALIDATE_APP_CONNECTION_CREDENTIALS_MAP: Record<AppConnection, TValidateAp[AppConnection.Snowflake]: ValidateSnowflakeConnectionCredentialsSchema,[AppConnection.Datadog]: ValidateDatadogConnectionCredentialsSchema,[AppConnection.F5BigIp]: ValidateF5BigIpConnectionCredentialsSchema,- [AppConnection.Convex]: ValidateConvexConnectionCredentialsSchema+ [AppConnection.Convex]: ValidateConvexConnectionCredentialsSchema,+ [AppConnection.Qovery]: ValidateQoveryConnectionCredentialsSchema};export const appConnectionServiceFactory = ({diff --git a/backend/src/services/app-connection/app-connection-types.ts b/backend/src/services/app-connection/app-connection-types.tsindex 3fccad5c92..a1eca110cd 100644--- a/backend/src/services/app-connection/app-connection-types.ts+++ b/backend/src/services/app-connection/app-connection-types.ts@@ -311,6 +311,12 @@ import {TPostgresConnectionInput,TValidatePostgresConnectionCredentialsSchema} from "./postgres";+import {+ TQoveryConnection,+ TQoveryConnectionConfig,+ TQoveryConnectionInput,+ TValidateQoveryConnectionCredentialsSchema+} from "./qovery";import {TRailwayConnection,TRailwayConnectionConfig,@@ -487,6 +493,7 @@ export type TAppConnection = { id: string; configuration?: TAppConnectionConfigu| TDatadogConnection| TF5BigIpConnection| TConvexConnection+ | TQoveryConnection);export type TAppConnectionRaw = NonNullable<Awaited<ReturnType<TAppConnectionDALFactory["findById"]>>>;@@ -568,6 +575,7 @@ export type TAppConnectionInput = { id: string } & (| TDatadogConnectionInput| TF5BigIpConnectionInput| TConvexConnectionInput+ | TQoveryConnectionInput);export type TSqlConnectionInput =@@ -680,7 +688,8 @@ export type TAppConnectionConfig =| TSnowflakeConnectionConfig| TDatadogConnectionConfig| TF5BigIpConnectionConfig- | TConvexConnectionConfig;+ | TConvexConnectionConfig+ | TQoveryConnectionConfig;export type TValidateAppConnectionCredentialsSchema =| TValidateAwsConnectionCredentialsSchema@@ -752,7 +761,8 @@ export type TValidateAppConnectionCredentialsSchema =| TValidateSnowflakeConnectionCredentialsSchema| TValidateDatadogConnectionCredentialsSchema| TValidateF5BigIpConnectionCredentialsSchema- | TValidateConvexConnectionCredentialsSchema;+ | TValidateConvexConnectionCredentialsSchema+ | TValidateQoveryConnectionCredentialsSchema;export type TListAwsConnectionKmsKeys = {connectionId: string;diff --git a/backend/src/services/app-connection/qovery/index.ts b/backend/src/services/app-connection/qovery/index.tsnew file mode 100644index 0000000000..53c784abb3--- /dev/null+++ b/backend/src/services/app-connection/qovery/index.ts@@ -0,0 +1,4 @@+export * from "./qovery-connection-enums";+export * from "./qovery-connection-fns";+export * from "./qovery-connection-schemas";+export * from "./qovery-connection-types";diff --git a/backend/src/services/app-connection/qovery/qovery-connection-enums.ts b/backend/src/services/app-connection/qovery/qovery-connection-enums.tsnew file mode 100644index 0000000000..c5e30f1579--- /dev/null+++ b/backend/src/services/app-connection/qovery/qovery-connection-enums.ts@@ -0,0 +1,3 @@+export enum QoveryConnectionMethod {+ AccessToken = "access-token"+}diff --git a/backend/src/services/app-connection/qovery/qovery-connection-fns.ts b/backend/src/services/app-connection/qovery/qovery-connection-fns.tsnew file mode 100644index 0000000000..39b7a6636c--- /dev/null+++ b/backend/src/services/app-connection/qovery/qovery-connection-fns.ts@@ -0,0 +1,56 @@+import { AxiosError } from "axios";++import { request } from "@app/lib/config/request";+import { BadRequestError } from "@app/lib/errors";+import { removeTrailingSlash } from "@app/lib/fn";+import { blockLocalAndPrivateIpAddresses } from "@app/lib/validator";++import { AppConnection } from "../app-connection-enums";+import { QoveryConnectionMethod } from "./qovery-connection-enums";+import { TQoveryConnectionConfig } from "./qovery-connection-types";++export const QOVERY_DEFAULT_API_URL = "https://api.qovery.com";++export const getQoveryInstanceUrl = async (config: TQoveryConnectionConfig) => {+ const instanceUrl = config.credentials.instanceUrl+ ? removeTrailingSlash(config.credentials.instanceUrl)+ : QOVERY_DEFAULT_API_URL;++ await blockLocalAndPrivateIpAddresses(instanceUrl);++ return instanceUrl;+};++export const getQoveryConnectionListItem = () => {+ return {+ name: "Qovery" as const,+ app: AppConnection.Qovery as const,+ methods: Object.values(QoveryConnectionMethod) as [QoveryConnectionMethod.AccessToken]+ };+};++export const validateQoveryConnectionCredentials = async (config: TQoveryConnectionConfig) => {+ const instanceUrl = await getQoveryInstanceUrl(config);+ const { accessToken } = config.credentials;++ try {+ await request.get(`${instanceUrl}/organization`, {+ headers: {+ Authorization: `Token ${accessToken}`,+ Accept: "application/json"+ }+ });+ } catch (error: unknown) {+ if (error instanceof AxiosError) {+ throw new BadRequestError({+ message: `Failed to validate Qovery credentials: ${error.message || "Unknown error"}`+ });+ }++ throw new BadRequestError({+ message: "Failed to validate Qovery credentials - verify the project access token is correct"+ });+ }++ return config.credentials;+};diff --git a/backend/src/services/app-connection/qovery/qovery-connection-schemas.ts b/backend/src/services/app-connection/qovery/qovery-connection-schemas.tsnew file mode 100644index 0000000000..00c8fae331--- /dev/null+++ b/backend/src/services/app-connection/qovery/qovery-connection-schemas.ts@@ -0,0 +1,74 @@+import z from "zod";++import { AppConnections } from "@app/lib/api-docs";+import { AppConnection } from "@app/services/app-connection/app-connection-enums";+import {+ BaseAppConnectionSchema,+ GenericCreateAppConnectionFieldsSchema,+ GenericUpdateAppConnectionFieldsSchema+} from "@app/services/app-connection/app-connection-schemas";++import { APP_CONNECTION_NAME_MAP } from "../app-connection-maps";+import { QoveryConnectionMethod } from "./qovery-connection-enums";++export const QoveryConnectionAccessTokenCredentialsSchema = z.object({+ accessToken: z+ .string()+ .trim()+ .min(1, "Project Access Token required")+ .describe(AppConnections.CREDENTIALS.QOVERY.accessToken),+ instanceUrl: z+ .string()+ .trim()+ .url("Invalid Instance URL")+ .max(255)+ .optional()+ .describe(AppConnections.CREDENTIALS.QOVERY.instanceUrl)+});++const BaseQoveryConnectionSchema = BaseAppConnectionSchema.extend({+ app: z.literal(AppConnection.Qovery)+});++export const QoveryConnectionSchema = z.discriminatedUnion("method", [+ BaseQoveryConnectionSchema.extend({+ method: z.literal(QoveryConnectionMethod.AccessToken),+ credentials: QoveryConnectionAccessTokenCredentialsSchema+ })+]);++export const SanitizedQoveryConnectionSchema = z.discriminatedUnion("method", [+ BaseQoveryConnectionSchema.extend({+ method: z.literal(QoveryConnectionMethod.AccessToken),+ credentials: QoveryConnectionAccessTokenCredentialsSchema.pick({ instanceUrl: true })+ }).describe(JSON.stringify({ title: `${APP_CONNECTION_NAME_MAP[AppConnection.Qovery]} (Access Token)` }))+]);++export const ValidateQoveryConnectionCredentialsSchema = z.discriminatedUnion("method", [+ z.object({+ method: z.literal(QoveryConnectionMethod.AccessToken).describe(AppConnections.CREATE(AppConnection.Qovery).method),+ credentials: QoveryConnectionAccessTokenCredentialsSchema.describe(+ AppConnections.CREATE(AppConnection.Qovery).credentials+ )+ })+]);++export const CreateQoveryConnectionSchema = ValidateQoveryConnectionCredentialsSchema.and(+ GenericCreateAppConnectionFieldsSchema(AppConnection.Qovery)+);++export const UpdateQoveryConnectionSchema = z+ .object({+ credentials: QoveryConnectionAccessTokenCredentialsSchema.optional().describe(+ AppConnections.UPDATE(AppConnection.Qovery).credentials+ )+ })+ .and(GenericUpdateAppConnectionFieldsSchema(AppConnection.Qovery));++export const QoveryConnectionListItemSchema = z+ .object({+ name: z.literal("Qovery"),+ app: z.literal(AppConnection.Qovery),+ methods: z.nativeEnum(QoveryConnectionMethod).array()+ })+ .describe(JSON.stringify({ title: APP_CONNECTION_NAME_MAP[AppConnection.Qovery] }));diff --git a/backend/src/services/app-connection/qovery/qovery-connection-types.ts b/backend/src/services/app-connection/qovery/qovery-connection-types.tsnew file mode 100644index 0000000000..9978491279--- /dev/null+++ b/backend/src/services/app-connection/qovery/qovery-connection-types.ts@@ -0,0 +1,20 @@+import z from "zod";++import { DiscriminativePick } from "@app/lib/types";++import { AppConnection } from "../app-connection-enums";+import {+ CreateQoveryConnectionSchema,+ QoveryConnectionSchema,+ ValidateQoveryConnectionCredentialsSchema+} from "./qovery-connection-schemas";++export type TQoveryConnection = z.infer<typeof QoveryConnectionSchema>;++export type TQoveryConnectionInput = z.infer<typeof CreateQoveryConnectionSchema> & {+ app: AppConnection.Qovery;+};++export type TValidateQoveryConnectionCredentialsSchema = typeof ValidateQoveryConnectionCredentialsSchema;++export type TQoveryConnectionConfig = DiscriminativePick<TQoveryConnectionInput, "method" | "app" | "credentials">;diff --git a/frontend/src/helpers/appConnections.ts b/frontend/src/helpers/appConnections.tsindex 509fa0470b..ab8d8c9428 100644--- a/frontend/src/helpers/appConnections.ts+++ b/frontend/src/helpers/appConnections.ts@@ -41,6 +41,7 @@ import {OnePassConnectionMethod,OracleDBConnectionMethod,PostgresConnectionMethod,+ QoveryConnectionMethod,RedisConnectionMethod,TAppConnection,TeamCityConnectionMethod,@@ -526,6 +527,12 @@ export const APP_CONNECTION_MAP: Record<category: "PLATFORM",description: "Project and deployment access for Convex."},+ [AppConnection.Qovery]: {+ name: "Qovery",+ image: "Qovery.png",+ category: "HOSTING",+ description: "Deploy and manage applications on Qovery."+ },[AppConnection.TriggerDev]: {name: "Trigger.dev",image: "TriggerDev.png",@@ -606,6 +613,7 @@ export const getAppConnectionMethodDetails = (method: TAppConnection["method"])case FlyioConnectionMethod.AccessToken:case NetlifyConnectionMethod.AccessToken:case ConvexConnectionMethod.PersonalAccessToken:+ case QoveryConnectionMethod.AccessToken:return { name: "Personal Access Token", icon: faKey };case Auth0ConnectionMethod.ClientCredentials:case SalesforceConnectionMethod.ClientCredentials:diff --git a/frontend/src/hooks/api/appConnections/enums.ts b/frontend/src/hooks/api/appConnections/enums.tsindex 28a77fade9..43527d8ecc 100644--- a/frontend/src/hooks/api/appConnections/enums.ts+++ b/frontend/src/hooks/api/appConnections/enums.ts@@ -68,5 +68,6 @@ export enum AppConnection {F5BigIp = "f5-big-ip",GoDaddy = "godaddy",Convex = "convex",- TriggerDev = "trigger-dev"+ TriggerDev = "trigger-dev",+ Qovery = "qovery"}diff --git a/frontend/src/hooks/api/appConnections/types/app-options.ts b/frontend/src/hooks/api/appConnections/types/app-options.tsindex 8538c09801..8fa99a7515 100644--- a/frontend/src/hooks/api/appConnections/types/app-options.ts+++ b/frontend/src/hooks/api/appConnections/types/app-options.ts@@ -102,6 +102,10 @@ export type TOctopusDeployConnectionOption = TAppConnectionOptionBase & {app: AppConnection.OctopusDeploy;};+export type TQoveryConnectionOption = TAppConnectionOptionBase & {+ app: AppConnection.Qovery;+};+export type TLdapConnectionOption = TAppConnectionOptionBase & {app: AppConnection.LDAP;};@@ -364,7 +368,8 @@ export type TAppConnectionOption =| TDatadogConnectionOption| TF5BigIpConnectionOption| TConvexConnectionOption- | TTriggerDevConnectionOption;+ | TTriggerDevConnectionOption+ | TQoveryConnectionOption;export type TAppConnectionOptionMap = {[AppConnection.AWS]: TAwsConnectionOption;@@ -437,4 +442,5 @@ export type TAppConnectionOptionMap = {[AppConnection.F5BigIp]: TF5BigIpConnectionOption;[AppConnection.Convex]: TConvexConnectionOption;[AppConnection.TriggerDev]: TTriggerDevConnectionOption;+ [AppConnection.Qovery]: TQoveryConnectionOption;};diff --git a/frontend/src/hooks/api/appConnections/types/index.ts b/frontend/src/hooks/api/appConnections/types/index.tsindex 745297a050..ca10e4a5f3 100644--- a/frontend/src/hooks/api/appConnections/types/index.ts+++ b/frontend/src/hooks/api/appConnections/types/index.ts@@ -53,6 +53,7 @@ import { TOpenRouterConnection } from "./open-router-connection";import { TOracleDBConnection } from "./oracledb-connection";import { TOvhConnection } from "./ovh-connection";import { TPostgresConnection } from "./postgres-connection";+import { TQoveryConnection } from "./qovery-connection";import { TRailwayConnection } from "./railway-connection";import { TRedisConnection } from "./redis-connection";import { TRenderConnection } from "./render-connection";@@ -121,6 +122,7 @@ export * from "./open-router-connection";export * from "./oracledb-connection";export * from "./ovh-connection";export * from "./postgres-connection";+export * from "./qovery-connection";export * from "./railway-connection";export * from "./redis-connection";export * from "./render-connection";@@ -209,7 +211,8 @@ export type TAppConnection =| TDatadogConnection| TF5BigIpConnection| TConvexConnection- | TTriggerDevConnection;+ | TTriggerDevConnection+ | TQoveryConnection;export type TAvailableAppConnection = Pick<TAppConnection, "name" | "id" | "projectId">;diff --git a/frontend/src/hooks/api/appConnections/types/qovery-connection.ts b/frontend/src/hooks/api/appConnections/types/qovery-connection.tsnew file mode 100644index 0000000000..57484f32b4--- /dev/null+++ b/frontend/src/hooks/api/appConnections/types/qovery-connection.ts@@ -0,0 +1,14 @@+import { AppConnection } from "@app/hooks/api/appConnections/enums";+import { TRootAppConnection } from "@app/hooks/api/appConnections/types/root-connection";++export enum QoveryConnectionMethod {+ AccessToken = "access-token"+}++export type TQoveryConnection = TRootAppConnection & { app: AppConnection.Qovery } & {+ method: QoveryConnectionMethod.AccessToken;+ credentials: {+ accessToken: string;+ instanceUrl?: string;+ };+};diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsxindex 75b0850194..91fcc41c76 100644--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx@@ -68,6 +68,7 @@ import { OpenRouterConnectionForm } from "./OpenRouterConnectionForm";import { OracleDBConnectionForm } from "./OracleDBConnectionForm";import { OVHConnectionForm } from "./OVHConnectionForm";import { PostgresConnectionForm } from "./PostgresConnectionForm";+import { QoveryConnectionForm } from "./QoveryConnectionForm";import { RailwayConnectionForm } from "./RailwayConnectionForm";import { RedisConnectionForm } from "./RedisConnectionForm";import { RenderConnectionForm } from "./RenderConnectionForm";@@ -278,6 +279,8 @@ const CreateForm = ({ app, onComplete, projectId }: CreateFormProps) => {return <MongoDBConnectionForm onSubmit={onSubmit} />;case AppConnection.OctopusDeploy:return <OctopusDeployConnectionForm onSubmit={onSubmit} />;+ case AppConnection.Qovery:+ return <QoveryConnectionForm onSubmit={onSubmit} />;case AppConnection.SSH:return <SshConnectionForm onSubmit={onSubmit} />;case AppConnection.Dbt:@@ -527,6 +530,8 @@ const UpdateForm = ({ appConnection, onComplete }: UpdateFormProps) => {return <MongoDBConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;case AppConnection.OctopusDeploy:return <OctopusDeployConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;+ case AppConnection.Qovery:+ return <QoveryConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;case AppConnection.SSH:return <SshConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;case AppConnection.Dbt:diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/QoveryConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/QoveryConnectionForm.tsxnew file mode 100644index 0000000000..e8d67dba9b--- /dev/null+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/QoveryConnectionForm.tsx@@ -0,0 +1,172 @@+import { Controller, FormProvider, useForm } from "react-hook-form";+import { zodResolver } from "@hookform/resolvers/zod";+import { Info } from "lucide-react";+import { z } from "zod";++import {+ Field,+ FieldError,+ FieldLabel,+ Input,+ SecretInput,+ Select,+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue,+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";+import { APP_CONNECTION_MAP, getAppConnectionMethodDetails } from "@app/helpers/appConnections";+import { QoveryConnectionMethod, TQoveryConnection } from "@app/hooks/api/appConnections";+import { AppConnection } from "@app/hooks/api/appConnections/enums";++import { AppConnectionFormFooter } from "./AppConnectionFormFooter";+import {+ genericAppConnectionFieldsSchema,+ GenericAppConnectionsFields+} from "./GenericAppConnectionFields";++type Props = {+ appConnection?: TQoveryConnection;+ onSubmit: (formData: FormData) => void;+};++const rootSchema = genericAppConnectionFieldsSchema.extend({+ app: z.literal(AppConnection.Qovery)+});++const formSchema = z.discriminatedUnion("method", [+ rootSchema.extend({+ method: z.literal(QoveryConnectionMethod.AccessToken),+ credentials: z.object({+ accessToken: z.string().trim().min(1, "Project Access Token required"),+ instanceUrl: z+ .string()+ .trim()+ .transform((value) => value || undefined)+ .refine((value) => (!value ? true : z.string().url().safeParse(value).success), {+ message: "Invalid Qovery API URL"+ })+ .optional()+ })+ })+]);++type FormData = z.infer<typeof formSchema>;++export const QoveryConnectionForm = ({ appConnection, onSubmit }: Props) => {+ const isUpdate = Boolean(appConnection);++ const form = useForm<FormData>({+ resolver: zodResolver(formSchema),+ defaultValues: appConnection ?? {+ app: AppConnection.Qovery,+ method: QoveryConnectionMethod.AccessToken,+ credentials: {+ instanceUrl: "https://api.qovery.com"+ }+ }+ });++ const { handleSubmit, control } = form;++ return (+ <FormProvider {...form}>+ <form onSubmit={handleSubmit(onSubmit)}>+ {!isUpdate && <GenericAppConnectionsFields />}+ <Controller+ name="method"+ control={control}+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel htmlFor="method">+ Method+ <Tooltip>+ <TooltipTrigger asChild>+ <Info />+ </TooltipTrigger>+ <TooltipContent className="max-w-sm">+ The method you would like to use to connect with{" "}+ {APP_CONNECTION_MAP[AppConnection.Qovery].name}. This field cannot be changed+ after creation.+ </TooltipContent>+ </Tooltip>+ </FieldLabel>+ <Select disabled={isUpdate} value={value} onValueChange={(val) => onChange(val)}>+ <SelectTrigger className="w-full" isError={Boolean(error)} id="method">+ <SelectValue placeholder="Select a method..." />+ </SelectTrigger>+ <SelectContent position="popper">+ {Object.values(QoveryConnectionMethod).map((method) => {+ return (+ <SelectItem value={method} key={method}>+ {getAppConnectionMethodDetails(method).name}{" "}+ </SelectItem>+ );+ })}+ </SelectContent>+ </Select>+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ name="credentials.accessToken"+ control={control}+ shouldUnregister+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel htmlFor="access-token">+ Project Access Token+ <Tooltip>+ <TooltipTrigger asChild>+ <Info />+ </TooltipTrigger>+ <TooltipContent className="max-w-sm">+ Your Qovery project access token. You can create one from the Qovery dashboard+ under your organization settings.+ </TooltipContent>+ </Tooltip>+ </FieldLabel>+ <SecretInput value={value} onChange={(e) => onChange(e.target.value)} />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ name="credentials.instanceUrl"+ control={control}+ shouldUnregister+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel htmlFor="instance-url">+ Qovery API URL+ <Tooltip>+ <TooltipTrigger asChild>+ <Info />+ </TooltipTrigger>+ <TooltipContent className="max-w-sm">+ Optional. Override only when connecting to a self-hosted Qovery instance.+ Defaults to https://api.qovery.com.+ </TooltipContent>+ </Tooltip>+ </FieldLabel>+ <Input+ id="instance-url"+ {...field}+ placeholder="https://api.qovery.com"+ isError={Boolean(error?.message)}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <AppConnectionFormFooter+ submitLabel={isUpdate ? "Update Credentials" : "Connect to Qovery"}+ />+ </form>+ </FormProvider>+ );+};