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 app connection
adilson4868c927c519
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.tsindex b523494c51..3f62f37b9c 100644--- a/backend/src/lib/api-docs/constants.ts+++ b/backend/src/lib/api-docs/constants.ts@@ -3124,6 +3124,10 @@ export const AppConnections = {apiKey: "The LiteLLM API key used to authenticate with the LiteLLM instance.",instanceUrl: "The base URL of your LiteLLM instance (e.g. https://litellm.example.com)."},+ KEEPER: {+ apiKey: "The API key generated for Keeper Commander Service Mode.",+ instanceUrl: "The base URL of your Keeper Commander Service Mode instance (e.g. https://keeper.company.com)."+ },FIREWORKS: {apiKey: "The Fireworks API key used to authenticate with the Fireworks API.",accountId: "The Fireworks account ID used to identify the Fireworks account."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 3ba62f659a..a649af867c 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@@ -145,6 +145,10 @@ import {HumanitecConnectionListItemSchema,SanitizedHumanitecConnectionSchema} from "@app/services/app-connection/humanitec";+import {+ KeeperConnectionListItemSchema,+ SanitizedKeeperConnectionSchema+} from "@app/services/app-connection/keeper";import {KempLoadMasterConnectionListItemSchema,SanitizedKempLoadMasterConnectionSchema@@ -357,7 +361,8 @@ const SanitizedAppConnectionSchema = z.union([...SanitizedPowerDnsConnectionSchema.options,...SanitizedSpaceliftConnectionSchema.options,...SanitizedDaytonaConnectionSchema.options,- ...SanitizedStripeConnectionSchema.options+ ...SanitizedStripeConnectionSchema.options,+ ...SanitizedKeeperConnectionSchema.options]);const AppConnectionOptionsSchema = z.discriminatedUnion("app", [@@ -446,7 +451,8 @@ const AppConnectionOptionsSchema = z.discriminatedUnion("app", [PowerDnsConnectionListItemSchema,SpaceliftConnectionListItemSchema,DaytonaConnectionListItemSchema,- StripeConnectionListItemSchema+ StripeConnectionListItemSchema,+ KeeperConnectionListItemSchema]);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 4b5b83f01a..99f5891ef9 100644--- a/backend/src/server/routes/v1/app-connection-routers/index.ts+++ b/backend/src/server/routes/v1/app-connection-routers/index.ts@@ -44,6 +44,7 @@ import { registerHasuraCloudConnectionRouter } from "./hasura-cloud-connection-rimport { registerHCVaultConnectionRouter } from "./hc-vault-connection-router";import { registerHerokuConnectionRouter } from "./heroku-connection-router";import { registerHumanitecConnectionRouter } from "./humanitec-connection-router";+import { registerKeeperConnectionRouter } from "./keeper-connection-router";import { registerKempLoadMasterConnectionRouter } from "./kemp-loadmaster-connection-router";import { registerLaravelForgeConnectionRouter } from "./laravel-forge-connection-router";import { registerLdapConnectionRouter } from "./ldap-connection-router";@@ -176,5 +177,6 @@ export const APP_CONNECTION_REGISTER_ROUTER_MAP: Record<AppConnection, (server:[AppConnection.NutanixPrismCentral]: registerNutanixPrismCentralConnectionRouter,[AppConnection.Spacelift]: registerSpaceliftConnectionRouter,[AppConnection.Daytona]: registerDaytonaConnectionRouter,- [AppConnection.Stripe]: registerStripeConnectionRouter+ [AppConnection.Stripe]: registerStripeConnectionRouter,+ [AppConnection.Keeper]: registerKeeperConnectionRouter};diff --git a/backend/src/server/routes/v1/app-connection-routers/keeper-connection-router.ts b/backend/src/server/routes/v1/app-connection-routers/keeper-connection-router.tsnew file mode 100644index 0000000000..67c879a725--- /dev/null+++ b/backend/src/server/routes/v1/app-connection-routers/keeper-connection-router.ts@@ -0,0 +1,18 @@+import { AppConnection } from "@app/services/app-connection/app-connection-enums";+import {+ CreateKeeperConnectionSchema,+ SanitizedKeeperConnectionSchema,+ UpdateKeeperConnectionSchema+} from "@app/services/app-connection/keeper";++import { registerAppConnectionEndpoints } from "./app-connection-endpoints";++export const registerKeeperConnectionRouter = async (server: FastifyZodProvider) => {+ registerAppConnectionEndpoints({+ app: AppConnection.Keeper,+ server,+ sanitizedResponseSchema: SanitizedKeeperConnectionSchema,+ createSchema: CreateKeeperConnectionSchema,+ updateSchema: UpdateKeeperConnectionSchema+ });+};diff --git a/backend/src/services/app-connection/app-connection-enums.ts b/backend/src/services/app-connection/app-connection-enums.tsindex dec249530e..bcd8e30747 100644--- a/backend/src/services/app-connection/app-connection-enums.ts+++ b/backend/src/services/app-connection/app-connection-enums.ts@@ -84,7 +84,8 @@ export enum AppConnection {PowerDns = "powerdns",Spacelift = "spacelift",Daytona = "daytona",- Stripe = "stripe"+ Stripe = "stripe",+ Keeper = "keeper"}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 e287e67300..adb7a4711e 100644--- a/backend/src/services/app-connection/app-connection-fns.ts+++ b/backend/src/services/app-connection/app-connection-fns.ts@@ -187,6 +187,7 @@ import {HumanitecConnectionMethod,validateHumanitecConnectionCredentials} from "./humanitec";+import { getKeeperConnectionListItem, KeeperConnectionMethod, validateKeeperConnectionCredentials } from "./keeper";import {getKempLoadMasterConnectionListItem,KempLoadMasterConnectionMethod,@@ -465,7 +466,8 @@ export const listAppConnectionOptions = (projectType?: ProjectType) => {getPowerDnsConnectionListItem(),getSpaceliftConnectionListItem(),getDaytonaConnectionListItem(),- getStripeConnectionListItem()+ getStripeConnectionListItem(),+ getKeeperConnectionListItem()].filter((option) => isAppConnectionAllowedInProject(option.app, projectType)).sort((a, b) => a.name.localeCompare(b.name));@@ -701,7 +703,8 @@ export const validateAppConnectionCredentials = async ([AppConnection.PowerDns]: validatePowerDnsConnectionCredentials as TAppConnectionCredentialsValidator,[AppConnection.Spacelift]: validateSpaceliftConnectionCredentials as TAppConnectionCredentialsValidator,[AppConnection.Daytona]: validateDaytonaConnectionCredentials as TAppConnectionCredentialsValidator,- [AppConnection.Stripe]: validateStripeConnectionCredentials as TAppConnectionCredentialsValidator+ [AppConnection.Stripe]: validateStripeConnectionCredentials as TAppConnectionCredentialsValidator,+ [AppConnection.Keeper]: validateKeeperConnectionCredentials as TAppConnectionCredentialsValidator};return VALIDATE_APP_CONNECTION_CREDENTIALS_MAP[appConnection.app](appConnection, gatewayV2Service);@@ -813,6 +816,7 @@ export const getAppConnectionMethodName = (method: TAppConnection["method"]) =>case NutanixPrismCentralConnectionMethod.ApiKey:case PowerDnsConnectionMethod.ApiKey:case DaytonaConnectionMethod.ApiKey:+ case KeeperConnectionMethod.ApiKey:return "API Key";case ChefConnectionMethod.UserKey:return "User Key";@@ -977,7 +981,8 @@ export const TRANSITION_CONNECTION_CREDENTIALS_TO_PLATFORM: Record<[AppConnection.PowerDns]: platformManagedCredentialsNotSupported,[AppConnection.Spacelift]: platformManagedCredentialsNotSupported,[AppConnection.Daytona]: platformManagedCredentialsNotSupported,- [AppConnection.Stripe]: platformManagedCredentialsNotSupported+ [AppConnection.Stripe]: platformManagedCredentialsNotSupported,+ [AppConnection.Keeper]: 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 e9fcc867fe..56211d013c 100644--- a/backend/src/services/app-connection/app-connection-maps.ts+++ b/backend/src/services/app-connection/app-connection-maps.ts@@ -86,7 +86,8 @@ export const APP_CONNECTION_NAME_MAP: Record<AppConnection, string> = {[AppConnection.Spacelift]: "Spacelift",[AppConnection.Daytona]: "Daytona",[AppConnection.MicrosoftIntune]: "Microsoft Intune",- [AppConnection.Stripe]: "Stripe"+ [AppConnection.Stripe]: "Stripe",+ [AppConnection.Keeper]: "Keeper"};export const APP_CONNECTION_PLAN_MAP: Record<AppConnection, AppConnectionPlanType> = {@@ -175,5 +176,6 @@ export const APP_CONNECTION_PLAN_MAP: Record<AppConnection, AppConnectionPlanTyp[AppConnection.Spacelift]: AppConnectionPlanType.Regular,[AppConnection.Daytona]: AppConnectionPlanType.Regular,[AppConnection.MicrosoftIntune]: AppConnectionPlanType.Enterprise,- [AppConnection.Stripe]: AppConnectionPlanType.Regular+ [AppConnection.Stripe]: AppConnectionPlanType.Regular,+ [AppConnection.Keeper]: AppConnectionPlanType.Regular};diff --git a/backend/src/services/app-connection/app-connection-service.ts b/backend/src/services/app-connection/app-connection-service.tsindex 1c1ef18aa5..9751a59aed 100644--- a/backend/src/services/app-connection/app-connection-service.ts+++ b/backend/src/services/app-connection/app-connection-service.ts@@ -136,6 +136,7 @@ import { ValidateHerokuConnectionCredentialsSchema } from "./heroku";import { herokuConnectionService } from "./heroku/heroku-connection-service";import { ValidateHumanitecConnectionCredentialsSchema } from "./humanitec";import { humanitecConnectionService } from "./humanitec/humanitec-connection-service";+import { ValidateKeeperConnectionCredentialsSchema } from "./keeper";import { ValidateKempLoadMasterConnectionCredentialsSchema } from "./kemp-loadmaster";import { kempLoadMasterConnectionService } from "./kemp-loadmaster/kemp-loadmaster-connection-service";import { ValidateLaravelForgeConnectionCredentialsSchema } from "./laravel-forge";@@ -318,7 +319,8 @@ const VALIDATE_APP_CONNECTION_CREDENTIALS_MAP: Record<AppConnection, TValidateAp[AppConnection.PowerDns]: ValidatePowerDnsConnectionCredentialsSchema,[AppConnection.Spacelift]: ValidateSpaceliftConnectionCredentialsSchema,[AppConnection.Daytona]: ValidateDaytonaConnectionCredentialsSchema,- [AppConnection.Stripe]: ValidateStripeConnectionCredentialsSchema+ [AppConnection.Stripe]: ValidateStripeConnectionCredentialsSchema,+ [AppConnection.Keeper]: ValidateKeeperConnectionCredentialsSchema};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 9fdee4dceb..157ef4ca5e 100644--- a/backend/src/services/app-connection/app-connection-types.ts+++ b/backend/src/services/app-connection/app-connection-types.ts@@ -267,6 +267,12 @@ import {THumanitecConnectionInput,TValidateHumanitecConnectionCredentialsSchema} from "./humanitec";+import {+ TKeeperConnection,+ TKeeperConnectionConfig,+ TKeeperConnectionInput,+ TValidateKeeperConnectionCredentialsSchema+} from "./keeper";import {TKempLoadMasterConnection,TKempLoadMasterConnectionConfig,@@ -598,6 +604,7 @@ export type TAppConnection = { id: string; configuration?: TAppConnectionConfigu| TSpaceliftConnection| TDaytonaConnection| TStripeConnection+ | TKeeperConnection);export type TAppConnectionRaw = NonNullable<Awaited<ReturnType<TAppConnectionDALFactory["findById"]>>>;@@ -695,6 +702,7 @@ export type TAppConnectionInput = { id: string } & (| TSpaceliftConnectionInput| TDaytonaConnectionInput| TStripeConnectionInput+ | TKeeperConnectionInput);export type TSqlConnectionInput =@@ -825,7 +833,8 @@ export type TAppConnectionConfig =| TPowerDnsConnectionConfig| TSpaceliftConnectionConfig| TDaytonaConnectionConfig- | TStripeConnectionConfig;+ | TStripeConnectionConfig+ | TKeeperConnectionConfig;export type TValidateAppConnectionCredentialsSchema =| TValidateAwsConnectionCredentialsSchema@@ -913,7 +922,8 @@ export type TValidateAppConnectionCredentialsSchema =| TValidatePowerDnsConnectionCredentialsSchema| TValidateSpaceliftConnectionCredentialsSchema| TValidateDaytonaConnectionCredentialsSchema- | TValidateStripeConnectionCredentialsSchema;+ | TValidateStripeConnectionCredentialsSchema+ | TValidateKeeperConnectionCredentialsSchema;export type TListAwsConnectionKmsKeys = {connectionId: string;diff --git a/backend/src/services/app-connection/keeper/index.ts b/backend/src/services/app-connection/keeper/index.tsnew file mode 100644index 0000000000..e96d2641c2--- /dev/null+++ b/backend/src/services/app-connection/keeper/index.ts@@ -0,0 +1,4 @@+export * from "./keeper-connection-enums";+export * from "./keeper-connection-fns";+export * from "./keeper-connection-schemas";+export * from "./keeper-connection-types";diff --git a/backend/src/services/app-connection/keeper/keeper-connection-enums.ts b/backend/src/services/app-connection/keeper/keeper-connection-enums.tsnew file mode 100644index 0000000000..4eaa3b13e7--- /dev/null+++ b/backend/src/services/app-connection/keeper/keeper-connection-enums.ts@@ -0,0 +1,3 @@+export enum KeeperConnectionMethod {+ ApiKey = "api-key"+}diff --git a/backend/src/services/app-connection/keeper/keeper-connection-fns.ts b/backend/src/services/app-connection/keeper/keeper-connection-fns.tsnew file mode 100644index 0000000000..a472b1956c--- /dev/null+++ b/backend/src/services/app-connection/keeper/keeper-connection-fns.ts@@ -0,0 +1,70 @@+import { HttpStatusCode, isAxiosError } from "axios";++import { BadRequestError } from "@app/lib/errors";+import { removeTrailingSlash } from "@app/lib/fn/string";+import { safeRequest } from "@app/lib/validator/safe-request";+import { AppConnection } from "@app/services/app-connection/app-connection-enums";++import { KeeperConnectionMethod } from "./keeper-connection-enums";+import { TKeeperConnectionConfig, TKeeperExecuteCommandResponse } from "./keeper-connection-types";++export const getKeeperConnectionListItem = () => {+ return {+ name: "Keeper" as const,+ app: AppConnection.Keeper as const,+ methods: Object.values(KeeperConnectionMethod) as [KeeperConnectionMethod.ApiKey]+ };+};++export const validateKeeperConnectionCredentials = async (config: TKeeperConnectionConfig) => {+ const { apiKey, instanceUrl } = config.credentials;+ const baseUrl = removeTrailingSlash(instanceUrl);++ let response: TKeeperExecuteCommandResponse | undefined;+ try {+ const { data } = await safeRequest.post<TKeeperExecuteCommandResponse>(+ `${baseUrl}/api/v1/executecommand`,+ { command: "whoami" },+ {+ headers: {+ "api-key": apiKey,+ Accept: "application/json",+ "Content-Type": "application/json"+ }+ }+ );+ response = data;+ } catch (error: unknown) {+ if (error instanceof BadRequestError) {+ throw error;+ }++ if (isAxiosError(error) && error.response) {+ const { status } = error.response;++ if (status === HttpStatusCode.Unauthorized || status === HttpStatusCode.Forbidden) {+ throw new BadRequestError({+ message: "Unable to validate connection: the Keeper API key was rejected. Verify the key and try again."+ });+ }++ throw new BadRequestError({+ message: `Unable to validate connection: Keeper Commander returned ${status} status. Verify the instance URL and API key and try again.`+ });+ }++ throw new BadRequestError({+ message:+ "Unable to validate connection: could not reach Keeper Commander. Verify the instance URL points to a running Commander Service Mode instance."+ });+ }++ if (response?.status !== "success") {+ throw new BadRequestError({+ message:+ "Unable to validate connection: Keeper Commander did not accept the request. Verify the API key is allowed to run the 'whoami' command."+ });+ }++ return config.credentials;+};diff --git a/backend/src/services/app-connection/keeper/keeper-connection-schemas.ts b/backend/src/services/app-connection/keeper/keeper-connection-schemas.tsnew file mode 100644index 0000000000..d115968f56--- /dev/null+++ b/backend/src/services/app-connection/keeper/keeper-connection-schemas.ts@@ -0,0 +1,71 @@+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 { KeeperConnectionMethod } from "./keeper-connection-enums";++export const KeeperConnectionApiKeyCredentialsSchema = z.object({+ apiKey: z+ .string()+ .trim()+ .min(1, "API Key required")+ .max(500, "API Key cannot exceed 500 characters")+ .describe(AppConnections.CREDENTIALS.KEEPER.apiKey),+ instanceUrl: z+ .string()+ .trim()+ .min(1, "Instance URL required")+ .max(255, "Instance URL cannot exceed 255 characters")+ .url("Invalid Instance URL")+ .describe(AppConnections.CREDENTIALS.KEEPER.instanceUrl)+});++const BaseKeeperConnectionSchema = BaseAppConnectionSchema.extend({ app: z.literal(AppConnection.Keeper) });++export const KeeperConnectionSchema = BaseKeeperConnectionSchema.extend({+ method: z.literal(KeeperConnectionMethod.ApiKey),+ credentials: KeeperConnectionApiKeyCredentialsSchema+});++export const SanitizedKeeperConnectionSchema = z.discriminatedUnion("method", [+ BaseKeeperConnectionSchema.extend({+ method: z.literal(KeeperConnectionMethod.ApiKey),+ credentials: KeeperConnectionApiKeyCredentialsSchema.pick({ instanceUrl: true })+ }).describe(JSON.stringify({ title: `${APP_CONNECTION_NAME_MAP[AppConnection.Keeper]} (API Key)` }))+]);++export const ValidateKeeperConnectionCredentialsSchema = z.discriminatedUnion("method", [+ z.object({+ method: z.literal(KeeperConnectionMethod.ApiKey).describe(AppConnections.CREATE(AppConnection.Keeper).method),+ credentials: KeeperConnectionApiKeyCredentialsSchema.describe(+ AppConnections.CREATE(AppConnection.Keeper).credentials+ )+ })+]);++export const CreateKeeperConnectionSchema = ValidateKeeperConnectionCredentialsSchema.and(+ GenericCreateAppConnectionFieldsSchema(AppConnection.Keeper)+);++export const UpdateKeeperConnectionSchema = z+ .object({+ credentials: KeeperConnectionApiKeyCredentialsSchema.optional().describe(+ AppConnections.UPDATE(AppConnection.Keeper).credentials+ )+ })+ .and(GenericUpdateAppConnectionFieldsSchema(AppConnection.Keeper));++export const KeeperConnectionListItemSchema = z+ .object({+ name: z.literal("Keeper"),+ app: z.literal(AppConnection.Keeper),+ methods: z.nativeEnum(KeeperConnectionMethod).array()+ })+ .describe(JSON.stringify({ title: APP_CONNECTION_NAME_MAP[AppConnection.Keeper] }));diff --git a/backend/src/services/app-connection/keeper/keeper-connection-types.ts b/backend/src/services/app-connection/keeper/keeper-connection-types.tsnew file mode 100644index 0000000000..f45396b1ed--- /dev/null+++ b/backend/src/services/app-connection/keeper/keeper-connection-types.ts@@ -0,0 +1,26 @@+import z from "zod";++import { DiscriminativePick } from "@app/lib/types";++import { AppConnection } from "../app-connection-enums";+import {+ CreateKeeperConnectionSchema,+ KeeperConnectionSchema,+ ValidateKeeperConnectionCredentialsSchema+} from "./keeper-connection-schemas";++export type TKeeperConnection = z.infer<typeof KeeperConnectionSchema>;++export type TKeeperConnectionInput = z.infer<typeof CreateKeeperConnectionSchema> & {+ app: AppConnection.Keeper;+};++export type TValidateKeeperConnectionCredentialsSchema = typeof ValidateKeeperConnectionCredentialsSchema;++export type TKeeperConnectionConfig = DiscriminativePick<TKeeperConnectionInput, "method" | "app" | "credentials"> & {+ orgId: string;+};++export type TKeeperExecuteCommandResponse = {+ status?: string;+};diff --git a/frontend/src/helpers/appConnections.ts b/frontend/src/helpers/appConnections.tsindex b1c8c3f1af..33ad4c77e7 100644--- a/frontend/src/helpers/appConnections.ts+++ b/frontend/src/helpers/appConnections.ts@@ -73,6 +73,7 @@ import { FireworksConnectionMethod } from "@app/hooks/api/appConnections/types/fimport { GoDaddyConnectionMethod } from "@app/hooks/api/appConnections/types/godaddy-connection";import { HasuraCloudConnectionMethod } from "@app/hooks/api/appConnections/types/hasura-cloud-connection";import { HerokuConnectionMethod } from "@app/hooks/api/appConnections/types/heroku-connection";+import { KeeperConnectionMethod } from "@app/hooks/api/appConnections/types/keeper-connection";import { KempLoadMasterConnectionMethod } from "@app/hooks/api/appConnections/types/kemp-loadmaster-connection";import { LaravelForgeConnectionMethod } from "@app/hooks/api/appConnections/types/laravel-forge-connection";import { LiteLLMConnectionMethod } from "@app/hooks/api/appConnections/types/litellm-connection";@@ -285,6 +286,12 @@ export const APP_CONNECTION_MAP: Record<category: "PASSWORD MANAGER",description: "Read and manage items in 1Password vaults."},+ [AppConnection.Keeper]: {+ name: "Keeper",+ image: "Keeper.png",+ category: "PASSWORD MANAGER",+ description: "Connect to Keeper Commander Service Mode."+ },[AppConnection.Heroku]: {name: "Heroku",image: "Heroku.png",@@ -757,6 +764,7 @@ export const getAppConnectionMethodDetails = (method: TAppConnection["method"])case DatadogConnectionMethod.ApiKey:case DaytonaConnectionMethod.ApiKey:case PowerDnsConnectionMethod.ApiKey:+ case KeeperConnectionMethod.ApiKey:return { name: "API Key", icon: KeyRoundIcon };case ChefConnectionMethod.UserKey:return { name: "User Key", icon: KeyRoundIcon };diff --git a/frontend/src/hooks/api/appConnections/enums.ts b/frontend/src/hooks/api/appConnections/enums.tsindex 669e07c66d..e2363b5cbf 100644--- a/frontend/src/hooks/api/appConnections/enums.ts+++ b/frontend/src/hooks/api/appConnections/enums.ts@@ -84,5 +84,6 @@ export enum AppConnection {NutanixPrismCentral = "nutanix-prism-central",Spacelift = "spacelift",Daytona = "daytona",- Stripe = "stripe"+ Stripe = "stripe",+ Keeper = "keeper"}diff --git a/frontend/src/hooks/api/appConnections/types/app-options.ts b/frontend/src/hooks/api/appConnections/types/app-options.tsindex 0d621e3a59..becc4e5500 100644--- a/frontend/src/hooks/api/appConnections/types/app-options.ts+++ b/frontend/src/hooks/api/appConnections/types/app-options.ts@@ -277,6 +277,10 @@ export type TNetScalerConnectionOption = TAppConnectionOptionBase & {app: AppConnection.NetScaler;};+export type TKeeperConnectionOption = TAppConnectionOptionBase & {+ app: AppConnection.Keeper;+};+export type TKempLoadMasterConnectionOption = TAppConnectionOptionBase & {app: AppConnection.KempLoadMaster;};@@ -424,6 +428,7 @@ export type TAppConnectionOption =| TExternalInfisicalConnectionOption| TDopplerConnectionOption| TNetScalerConnectionOption+ | TKeeperConnectionOption| TKempLoadMasterConnectionOption| TAnthropicConnectionOption| TOvhConnectionOption@@ -512,6 +517,7 @@ export type TAppConnectionOptionMap = {[AppConnection.ExternalInfisical]: TExternalInfisicalConnectionOption;[AppConnection.Doppler]: TDopplerConnectionOption;[AppConnection.NetScaler]: TNetScalerConnectionOption;+ [AppConnection.Keeper]: TKeeperConnectionOption;[AppConnection.KempLoadMaster]: TKempLoadMasterConnectionOption;[AppConnection.Anthropic]: TAnthropicConnectionOption;[AppConnection.OVH]: TOvhConnectionOption;diff --git a/frontend/src/hooks/api/appConnections/types/index.ts b/frontend/src/hooks/api/appConnections/types/index.tsindex 9df88a0039..33e724a09e 100644--- a/frontend/src/hooks/api/appConnections/types/index.ts+++ b/frontend/src/hooks/api/appConnections/types/index.ts@@ -42,6 +42,7 @@ import { THasuraCloudConnection } from "./hasura-cloud-connection";import { THCVaultConnection } from "./hc-vault-connection";import { THerokuConnection } from "./heroku-connection";import { THumanitecConnection } from "./humanitec-connection";+import { TKeeperConnection } from "./keeper-connection";import { TKempLoadMasterConnection } from "./kemp-loadmaster-connection";import { TLaravelForgeConnection } from "./laravel-forge-connection";import { TLdapConnection } from "./ldap-connection";@@ -126,6 +127,7 @@ export * from "./hasura-cloud-connection";export * from "./hc-vault-connection";export * from "./heroku-connection";export * from "./humanitec-connection";+export * from "./keeper-connection";export * from "./kemp-loadmaster-connection";export * from "./laravel-forge-connection";export * from "./ldap-connection";@@ -257,7 +259,8 @@ export type TAppConnection =| TPowerDnsConnection| TSpaceliftConnection| TDaytonaConnection- | TStripeConnection;+ | TStripeConnection+ | TKeeperConnection;export type TAvailableAppConnection = Pick<TAppConnection, "name" | "id" | "projectId">;diff --git a/frontend/src/hooks/api/appConnections/types/keeper-connection.ts b/frontend/src/hooks/api/appConnections/types/keeper-connection.tsnew file mode 100644index 0000000000..ae6a39d46c--- /dev/null+++ b/frontend/src/hooks/api/appConnections/types/keeper-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 KeeperConnectionMethod {+ ApiKey = "api-key"+}++export type TKeeperConnection = TRootAppConnection & { app: AppConnection.Keeper } & {+ method: KeeperConnectionMethod.ApiKey;+ credentials: {+ apiKey: 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 fc22a2b9fd..aba5863a2e 100644--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx@@ -56,6 +56,7 @@ import { HasuraCloudConnectionForm } from "./HasuraCloudConnectionForm";import { HCVaultConnectionForm } from "./HCVaultConnectionForm";import { HerokuConnectionForm } from "./HerokuAppConnectionForm";import { HumanitecConnectionForm } from "./HumanitecConnectionForm";+import { KeeperConnectionForm } from "./KeeperConnectionForm";import { KempLoadMasterConnectionForm } from "./KempLoadMasterConnectionForm";import { LaravelForgeConnectionForm } from "./LaravelForgeConnectionForm";import { LdapConnectionForm } from "./LdapConnectionForm";@@ -343,6 +344,8 @@ const CreateForm = ({ app, onComplete, projectId }: CreateFormProps) => {return <DopplerConnectionForm onSubmit={onSubmit} />;case AppConnection.NetScaler:return <NetScalerConnectionForm onSubmit={onSubmit} />;+ case AppConnection.Keeper:+ return <KeeperConnectionForm onSubmit={onSubmit} />;case AppConnection.KempLoadMaster:return <KempLoadMasterConnectionForm onSubmit={onSubmit} />;case AppConnection.OVH:@@ -624,6 +627,8 @@ const UpdateForm = ({ appConnection, onComplete }: UpdateFormProps) => {return <DopplerConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;case AppConnection.NetScaler:return <NetScalerConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;+ case AppConnection.Keeper:+ return <KeeperConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;case AppConnection.KempLoadMaster:return <KempLoadMasterConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;case AppConnection.OVH:diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/KeeperConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/KeeperConnectionForm.tsxnew file mode 100644index 0000000000..14c3bd4943--- /dev/null+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/KeeperConnectionForm.tsx@@ -0,0 +1,132 @@+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,+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";+import { AppConnection } from "@app/hooks/api/appConnections/enums";+import {+ KeeperConnectionMethod,+ TKeeperConnection+} from "@app/hooks/api/appConnections/types/keeper-connection";++import { AppConnectionFormFooter } from "./AppConnectionFormFooter";+import {+ genericAppConnectionFieldsSchema,+ GenericAppConnectionsFields+} from "./GenericAppConnectionFields";++type Props = {+ appConnection?: TKeeperConnection;+ onSubmit: (formData: FormData) => void;+};++const rootSchema = genericAppConnectionFieldsSchema.extend({+ app: z.literal(AppConnection.Keeper)+});++const formSchema = z.discriminatedUnion("method", [+ rootSchema.extend({+ method: z.literal(KeeperConnectionMethod.ApiKey),+ credentials: z.object({+ instanceUrl: z+ .string()+ .trim()+ .url("Invalid Instance URL")+ .min(1, "Instance URL required")+ .max(255),+ apiKey: z.string().trim().min(1, "API Key required").max(500)+ })+ })+]);++type FormData = z.infer<typeof formSchema>;++export const KeeperConnectionForm = ({ appConnection, onSubmit }: Props) => {+ const isUpdate = Boolean(appConnection);++ const form = useForm<FormData>({+ resolver: zodResolver(formSchema),+ defaultValues: appConnection ?? {+ app: AppConnection.Keeper,+ method: KeeperConnectionMethod.ApiKey+ }+ });++ const { handleSubmit, control } = form;++ return (+ <FormProvider {...form}>+ <form onSubmit={handleSubmit(onSubmit)}>+ {!isUpdate && <GenericAppConnectionsFields />}+ <Controller+ name="credentials.instanceUrl"+ control={control}+ shouldUnregister+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel htmlFor="instance-url">+ Instance URL+ <Tooltip>+ <TooltipTrigger asChild>+ <Info />+ </TooltipTrigger>+ <TooltipContent className="max-w-sm">+ The URL of your Keeper Commander instance (e.g., https://keeper.company.com).+ </TooltipContent>+ </Tooltip>+ </FieldLabel>+ <Input+ id="instance-url"+ {...field}+ placeholder="https://keeper.company.com"+ isError={Boolean(error?.message)}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ name="credentials.apiKey"+ control={control}+ shouldUnregister+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel htmlFor="api-key">+ API Key+ <Tooltip>+ <TooltipTrigger asChild>+ <Info />+ </TooltipTrigger>+ <TooltipContent className="max-w-sm">+ The API key generated for Keeper Commander Service Mode.+ </TooltipContent>+ </Tooltip>+ </FieldLabel>+ <SecretInput+ aria-describedby={error ? "api-key-error" : undefined}+ id="api-key"+ isError={Boolean(error)}+ value={value}+ onChange={(e) => onChange(e.target.value)}+ />+ <FieldError id="api-key-error" errors={[error]} />+ </Field>+ )}+ />+ <AppConnectionFormFooter+ submitLabel={isUpdate ? "Update Credentials" : "Connect to Keeper"}+ />+ </form>+ </FormProvider>+ );+};