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
improvements: address feedback
Scott Wilson636aee2ea98a
diff --git a/backend/src/ee/services/license/license-fns.ts b/backend/src/ee/services/license/license-fns.tsindex 3f4af174b7..21d3788028 100644--- a/backend/src/ee/services/license/license-fns.ts+++ b/backend/src/ee/services/license/license-fns.ts@@ -39,7 +39,7 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({trial_end: null,has_used_trial: true,secretApproval: false,- secretRotation: false,+ secretRotation: true,caCrl: false,instanceUserManagement: false,externalKms: false,diff --git a/backend/src/ee/services/secret-rotation-v2/ldap-password/ldap-password-rotation-constants.ts b/backend/src/ee/services/secret-rotation-v2/ldap-password/ldap-password-rotation-constants.tsindex b46165c71b..061bf11ea5 100644--- a/backend/src/ee/services/secret-rotation-v2/ldap-password/ldap-password-rotation-constants.ts+++ b/backend/src/ee/services/secret-rotation-v2/ldap-password/ldap-password-rotation-constants.ts@@ -5,7 +5,7 @@ import { AppConnection } from "@app/services/app-connection/app-connection-enumsexport const LDAP_PASSWORD_ROTATION_LIST_OPTION: TSecretRotationV2ListItem = {name: "LDAP Password",type: SecretRotation.LdapPassword,- connection: AppConnection.Ldap,+ connection: AppConnection.LDAP,template: {secretsMapping: {dn: "LDAP_DN",diff --git a/backend/src/ee/services/secret-rotation-v2/ldap-password/ldap-password-rotation-schemas.ts b/backend/src/ee/services/secret-rotation-v2/ldap-password/ldap-password-rotation-schemas.tsindex 2fc832c14d..9441a4cb98 100644--- a/backend/src/ee/services/secret-rotation-v2/ldap-password/ldap-password-rotation-schemas.ts+++ b/backend/src/ee/services/secret-rotation-v2/ldap-password/ldap-password-rotation-schemas.ts@@ -59,7 +59,7 @@ export const UpdateLdapPasswordRotationSchema = BaseUpdateSecretRotationSchema(Sexport const LdapPasswordRotationListItemSchema = z.object({name: z.literal("LDAP Password"),- connection: z.literal(AppConnection.Ldap),+ connection: z.literal(AppConnection.LDAP),type: z.literal(SecretRotation.LdapPassword),template: LdapPasswordRotationTemplateSchema});diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-maps.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-maps.tsindex c1bdcce990..0b9fc29f07 100644--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-maps.ts+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-maps.ts@@ -3,7 +3,7 @@ import { AppConnection } from "@app/services/app-connection/app-connection-enumsexport const SECRET_ROTATION_NAME_MAP: Record<SecretRotation, string> = {[SecretRotation.PostgresCredentials]: "PostgreSQL Credentials",- [SecretRotation.MsSqlCredentials]: "Microsoft SQL Sever Credentials",+ [SecretRotation.MsSqlCredentials]: "Microsoft SQL Server Credentials",[SecretRotation.Auth0ClientSecret]: "Auth0 Client Secret",[SecretRotation.LdapPassword]: "LDAP Password"};@@ -12,5 +12,5 @@ export const SECRET_ROTATION_CONNECTION_MAP: Record<SecretRotation, AppConnectio[SecretRotation.PostgresCredentials]: AppConnection.Postgres,[SecretRotation.MsSqlCredentials]: AppConnection.MsSql,[SecretRotation.Auth0ClientSecret]: AppConnection.Auth0,- [SecretRotation.LdapPassword]: AppConnection.Ldap+ [SecretRotation.LdapPassword]: AppConnection.LDAP};diff --git a/backend/src/ee/services/secret-rotation-v2/shared/general/password-requirements-schema.ts b/backend/src/ee/services/secret-rotation-v2/shared/general/password-requirements-schema.tsindex 086e718f5c..74d8ddf401 100644--- a/backend/src/ee/services/secret-rotation-v2/shared/general/password-requirements-schema.ts+++ b/backend/src/ee/services/secret-rotation-v2/shared/general/password-requirements-schema.ts@@ -32,6 +32,9 @@ export const PasswordRequirementsSchema = z.optional().describe(SecretRotations.PARAMETERS.GENERAL.PASSWORD_REQUIREMENTS.allowedSymbols)})+ .refine((data) => {+ return Object.values(data.required).some((count) => count > 0);+ }, "At least one character type must be required").refine((data) => {const total = Object.values(data.required).reduce((sum, count) => sum + count, 0);return total <= data.length;diff --git a/backend/src/server/routes/v1/app-connection-routers/index.ts b/backend/src/server/routes/v1/app-connection-routers/index.tsindex 9c6b0065e7..c253de237f 100644--- a/backend/src/server/routes/v1/app-connection-routers/index.ts+++ b/backend/src/server/routes/v1/app-connection-routers/index.ts@@ -34,5 +34,5 @@ export const APP_CONNECTION_REGISTER_ROUTER_MAP: Record<AppConnection, (server:[AppConnection.Camunda]: registerCamundaConnectionRouter,[AppConnection.Windmill]: registerWindmillConnectionRouter,[AppConnection.Auth0]: registerAuth0ConnectionRouter,- [AppConnection.Ldap]: registerLdapConnectionRouter+ [AppConnection.LDAP]: registerLdapConnectionRouter};diff --git a/backend/src/server/routes/v1/app-connection-routers/ldap-connection-router.ts b/backend/src/server/routes/v1/app-connection-routers/ldap-connection-router.tsindex d6e820fbac..d415707cca 100644--- a/backend/src/server/routes/v1/app-connection-routers/ldap-connection-router.ts+++ b/backend/src/server/routes/v1/app-connection-routers/ldap-connection-router.ts@@ -9,7 +9,7 @@ import { registerAppConnectionEndpoints } from "./app-connection-endpoints";export const registerLdapConnectionRouter = async (server: FastifyZodProvider) => {registerAppConnectionEndpoints({- app: AppConnection.Ldap,+ app: AppConnection.LDAP,server,sanitizedResponseSchema: SanitizedLdapConnectionSchema,createSchema: CreateLdapConnectionSchema,diff --git a/backend/src/services/app-connection/app-connection-enums.ts b/backend/src/services/app-connection/app-connection-enums.tsindex b4404c3943..5960da356f 100644--- a/backend/src/services/app-connection/app-connection-enums.ts+++ b/backend/src/services/app-connection/app-connection-enums.ts@@ -13,7 +13,7 @@ export enum AppConnection {Camunda = "camunda",Windmill = "windmill",Auth0 = "auth0",- Ldap = "ldap"+ LDAP = "ldap"}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 e444ea21a0..ba0ba260eb 100644--- a/backend/src/services/app-connection/app-connection-fns.ts+++ b/backend/src/services/app-connection/app-connection-fns.ts@@ -138,7 +138,7 @@ export const validateAppConnectionCredentials = async ([AppConnection.TerraformCloud]: validateTerraformCloudConnectionCredentials as TAppConnectionCredentialsValidator,[AppConnection.Auth0]: validateAuth0ConnectionCredentials as TAppConnectionCredentialsValidator,[AppConnection.Windmill]: validateWindmillConnectionCredentials as TAppConnectionCredentialsValidator,- [AppConnection.Ldap]: validateLdapConnectionCredentials as TAppConnectionCredentialsValidator+ [AppConnection.LDAP]: validateLdapConnectionCredentials as TAppConnectionCredentialsValidator};return VALIDATE_APP_CONNECTION_CREDENTIALS_MAP[appConnection.app](appConnection);@@ -220,5 +220,5 @@ export const TRANSITION_CONNECTION_CREDENTIALS_TO_PLATFORM: Record<[AppConnection.Vercel]: platformManagedCredentialsNotSupported,[AppConnection.Windmill]: platformManagedCredentialsNotSupported,[AppConnection.Auth0]: platformManagedCredentialsNotSupported,- [AppConnection.Ldap]: platformManagedCredentialsNotSupported // we could support this in the future+ [AppConnection.LDAP]: platformManagedCredentialsNotSupported // we could support this in the future};diff --git a/backend/src/services/app-connection/app-connection-maps.ts b/backend/src/services/app-connection/app-connection-maps.tsindex 886aa49555..b98636dd13 100644--- a/backend/src/services/app-connection/app-connection-maps.ts+++ b/backend/src/services/app-connection/app-connection-maps.ts@@ -15,5 +15,5 @@ export const APP_CONNECTION_NAME_MAP: Record<AppConnection, string> = {[AppConnection.Camunda]: "Camunda",[AppConnection.Windmill]: "Windmill",[AppConnection.Auth0]: "Auth0",- [AppConnection.Ldap]: "LDAP"+ [AppConnection.LDAP]: "LDAP"};diff --git a/backend/src/services/app-connection/app-connection-service.ts b/backend/src/services/app-connection/app-connection-service.tsindex 27152da52d..f2a8389724 100644--- a/backend/src/services/app-connection/app-connection-service.ts+++ b/backend/src/services/app-connection/app-connection-service.ts@@ -76,7 +76,7 @@ const VALIDATE_APP_CONNECTION_CREDENTIALS_MAP: Record<AppConnection, TValidateAp[AppConnection.Camunda]: ValidateCamundaConnectionCredentialsSchema,[AppConnection.Windmill]: ValidateWindmillConnectionCredentialsSchema,[AppConnection.Auth0]: ValidateAuth0ConnectionCredentialsSchema,- [AppConnection.Ldap]: ValidateLdapConnectionCredentialsSchema+ [AppConnection.LDAP]: ValidateLdapConnectionCredentialsSchema};export const appConnectionServiceFactory = ({diff --git a/backend/src/services/app-connection/ldap/ldap-connection-fns.ts b/backend/src/services/app-connection/ldap/ldap-connection-fns.tsindex 10da004ebd..2258557689 100644--- a/backend/src/services/app-connection/ldap/ldap-connection-fns.ts+++ b/backend/src/services/app-connection/ldap/ldap-connection-fns.ts@@ -11,7 +11,7 @@ import { TLdapConnectionConfig } from "./ldap-connection-types";export const getLdapConnectionListItem = () => {return {name: "LDAP" as const,- app: AppConnection.Ldap as const,+ app: AppConnection.LDAP as const,methods: Object.values(LdapConnectionMethod) as [LdapConnectionMethod.SimpleBind]};};diff --git a/backend/src/services/app-connection/ldap/ldap-connection-schemas.ts b/backend/src/services/app-connection/ldap/ldap-connection-schemas.tsindex 6cd957c151..3943fa2ff6 100644--- a/backend/src/services/app-connection/ldap/ldap-connection-schemas.ts+++ b/backend/src/services/app-connection/ldap/ldap-connection-schemas.ts@@ -12,7 +12,12 @@ import { LdapConnectionMethod, LdapProvider } from "./ldap-connection-enums";export const LdapConnectionSimpleBindCredentialsSchema = z.object({provider: z.nativeEnum(LdapProvider).describe(AppConnections.CREDENTIALS.LDAP.provider),- url: z.string().trim().min(1, "URL required").describe(AppConnections.CREDENTIALS.LDAP.url),+ url: z+ .string()+ .trim()+ .min(1, "URL required")+ .refine((value) => value.startsWith("ldap://") || value.startsWith("ldaps://"))+ .describe(AppConnections.CREDENTIALS.LDAP.url),dn: z.string().trim().min(1, "Distinguished Name (DN) required").describe(AppConnections.CREDENTIALS.LDAP.dn),password: z.string().trim().min(1, "Password required").describe(AppConnections.CREDENTIALS.LDAP.password),sslRejectUnauthorized: z.boolean().optional().describe(AppConnections.CREDENTIALS.LDAP.sslRejectUnauthorized),@@ -25,7 +30,7 @@ export const LdapConnectionSimpleBindCredentialsSchema = z.object({});const BaseLdapConnectionSchema = BaseAppConnectionSchema.extend({- app: z.literal(AppConnection.Ldap)+ app: z.literal(AppConnection.LDAP)});export const LdapConnectionSchema = z.intersection(@@ -54,28 +59,28 @@ export const SanitizedLdapConnectionSchema = z.discriminatedUnion("method", [export const ValidateLdapConnectionCredentialsSchema = z.discriminatedUnion("method", [z.object({- method: z.literal(LdapConnectionMethod.SimpleBind).describe(AppConnections.CREATE(AppConnection.Ldap).method),+ method: z.literal(LdapConnectionMethod.SimpleBind).describe(AppConnections.CREATE(AppConnection.LDAP).method),credentials: LdapConnectionSimpleBindCredentialsSchema.describe(- AppConnections.CREATE(AppConnection.Ldap).credentials+ AppConnections.CREATE(AppConnection.LDAP).credentials)})]);export const CreateLdapConnectionSchema = ValidateLdapConnectionCredentialsSchema.and(- GenericCreateAppConnectionFieldsSchema(AppConnection.Ldap)+ GenericCreateAppConnectionFieldsSchema(AppConnection.LDAP));export const UpdateLdapConnectionSchema = z.object({credentials: LdapConnectionSimpleBindCredentialsSchema.optional().describe(- AppConnections.UPDATE(AppConnection.Ldap).credentials+ AppConnections.UPDATE(AppConnection.LDAP).credentials)})- .and(GenericUpdateAppConnectionFieldsSchema(AppConnection.Ldap));+ .and(GenericUpdateAppConnectionFieldsSchema(AppConnection.LDAP));export const LdapConnectionListItemSchema = z.object({name: z.literal("LDAP"),- app: z.literal(AppConnection.Ldap),+ app: z.literal(AppConnection.LDAP),// the below is preferable but currently breaks with our zod to json schema parser// methods: z.tuple([z.literal(AwsConnectionMethod.ServicePrincipal), z.literal(AwsConnectionMethod.AccessKey)]),methods: z.nativeEnum(LdapConnectionMethod).array()diff --git a/backend/src/services/app-connection/ldap/ldap-connection-types.ts b/backend/src/services/app-connection/ldap/ldap-connection-types.tsindex 4d324a9323..ee69b2542e 100644--- a/backend/src/services/app-connection/ldap/ldap-connection-types.ts+++ b/backend/src/services/app-connection/ldap/ldap-connection-types.ts@@ -12,7 +12,7 @@ import {export type TLdapConnection = z.infer<typeof LdapConnectionSchema>;export type TLdapConnectionInput = z.infer<typeof CreateLdapConnectionSchema> & {- app: AppConnection.Ldap;+ app: AppConnection.LDAP;};export type TValidateLdapConnectionCredentialsSchema = typeof ValidateLdapConnectionCredentialsSchema;diff --git a/docs/documentation/platform/secret-rotation/ldap-password.mdx b/docs/documentation/platform/secret-rotation/ldap-password.mdxindex 53802b8a9b..103fe46569 100644--- a/docs/documentation/platform/secret-rotation/ldap-password.mdx+++ b/docs/documentation/platform/secret-rotation/ldap-password.mdx@@ -114,8 +114,8 @@ description: "Learn how to automatically rotate LDAP passwords."{"secretRotation": {"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",- "name": "my-auth0-rotation",- "description": "my client secret rotation",+ "name": "my-ldap-rotation",+ "description": "my ldap password rotation","secretsMapping": {"dn": "LDAP_DN","password": "LDAP_PASSWORD"@@ -133,8 +133,8 @@ description: "Learn how to automatically rotate LDAP passwords.""lastRotationJobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a","nextRotationAt": "2023-11-07T05:31:56Z","connection": {- "app": "auth0",- "name": "my-auth0-connection",+ "app": "ldap",+ "name": "my-ldap-connection","id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"},"environment": {diff --git a/docs/integrations/app-connections/ldap.mdx b/docs/integrations/app-connections/ldap.mdxindex de96173ccf..63c4bfed1f 100644--- a/docs/integrations/app-connections/ldap.mdx+++ b/docs/integrations/app-connections/ldap.mdx@@ -62,7 +62,7 @@ Depending on how you intend to use your LDAP connection, there may be additional"provider": "active-directory","url": "ldaps://domain-or-ip:636","dn": "CN=John,CN=Users,DC=example,DC=com",- "password": "my-strong-password",+ "password": "<your-secure-password>","sslRejectUnauthorized": true,"sslCertificate": "..."}diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/LdapPasswordRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/LdapPasswordRotationParametersFields.tsxindex 135abff4ec..9c9d8329f6 100644--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/LdapPasswordRotationParametersFields.tsx+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/LdapPasswordRotationParametersFields.tsx@@ -1,10 +1,8 @@import { Controller, useFormContext } from "react-hook-form";-import { faCircleInfo } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";import { DEFAULT_PASSWORD_REQUIREMENTS } from "@app/components/secret-rotations-v2/forms/schemas/shared";-import { FormControl, Input, Tooltip } from "@app/components/v2";+import { FormControl, Input } from "@app/components/v2";import { SecretRotation } from "@app/hooks/api/secretRotationsV2";export const LdapPasswordRotationParametersFields = () => {@@ -24,37 +22,7 @@ export const LdapPasswordRotationParametersFields = () => {isError={Boolean(error)}errorText={error?.message}label="Distinguished Name (DN)"- helperText={- <Tooltip- className="max-w-md"- content={- <>- Ensure that your connection has the{" "}- <span className="font-semibold">read_clients</span> permission and the- application exists in the connection's audience.- </>- }- >- <div>- <span>Don't see the application you're looking for?</span>{" "}- <FontAwesomeIcon icon={faCircleInfo} className="text-mineshaft-400" />- </div>- </Tooltip>- }>- {/* <FilterableSelect- menuPlacement="top"- isLoading={isClientsPending && Boolean(connectionId)}- isDisabled={!connectionId}- value={clients?.find((client) => client.id === value) ?? null}- onChange={(option) => {- onChange((option as SingleValue<TAuth0Client>)?.id ?? null);- }}- options={clients}- placeholder="Select an application..."- getOptionLabel={(option) => option.name}- getOptionValue={(option) => option.id}- /> */}<Inputvalue={value}onChange={onChange}@@ -74,7 +42,7 @@ export const LdapPasswordRotationParametersFields = () => {defaultValue={DEFAULT_PASSWORD_REQUIREMENTS.length}render={({ field, fieldState: { error } }) => (<FormControl- label="Passsword Length"+ label="Password Length"isError={Boolean(error)}errorText={error?.message}helperText="The length of the password to generate"@@ -189,7 +157,7 @@ export const LdapPasswordRotationParametersFields = () => {placeholder="-_.~!*"size="sm"{...field}- onChange={(e) => field.onChange(Number(e.target.value))}+ onChange={(e) => field.onChange(e.target.value)}/></FormControl>)}diff --git a/frontend/src/components/secret-rotations-v2/forms/schemas/shared/password-requirements-schema.ts b/frontend/src/components/secret-rotations-v2/forms/schemas/shared/password-requirements-schema.tsindex 640ecdd884..05b673ab61 100644--- a/frontend/src/components/secret-rotations-v2/forms/schemas/shared/password-requirements-schema.ts+++ b/frontend/src/components/secret-rotations-v2/forms/schemas/shared/password-requirements-schema.ts@@ -15,8 +15,17 @@ export const PasswordRequirementsSchema = zallowedSymbols: z.string().optional()- .transform((value) => value ?? "-_.~!*")+ .transform((value) => value || "-_.~!*")})+ .refine(+ (data) => {+ return Object.values(data.required).some((count) => count > 0);+ },+ {+ message: "At least one character type must be required",+ path: ["required.digits"]+ }+ ).refine((data) => {const total = Object.values(data.required).reduce((sum, count) => sum + count, 0);diff --git a/frontend/src/helpers/appConnections.ts b/frontend/src/helpers/appConnections.tsindex ef8329b973..64ae2a699c 100644--- a/frontend/src/helpers/appConnections.ts+++ b/frontend/src/helpers/appConnections.ts@@ -52,7 +52,7 @@ export const APP_CONNECTION_MAP: Record<[AppConnection.Camunda]: { name: "Camunda", image: "Camunda.png" },[AppConnection.Windmill]: { name: "Windmill", image: "Windmill.png" },[AppConnection.Auth0]: { name: "Auth0", image: "Auth0.png", size: 40 },- [AppConnection.Ldap]: { name: "LDAP", image: "LDAP.png", size: 65 }+ [AppConnection.LDAP]: { name: "LDAP", image: "LDAP.png", size: 65 }};export const getAppConnectionMethodDetails = (method: TAppConnection["method"]) => {diff --git a/frontend/src/helpers/secretRotationsV2.ts b/frontend/src/helpers/secretRotationsV2.tsindex 73b6e141ca..92e5d5257b 100644--- a/frontend/src/helpers/secretRotationsV2.ts+++ b/frontend/src/helpers/secretRotationsV2.ts@@ -31,7 +31,7 @@ export const SECRET_ROTATION_CONNECTION_MAP: Record<SecretRotation, AppConnectio[SecretRotation.PostgresCredentials]: AppConnection.Postgres,[SecretRotation.MsSqlCredentials]: AppConnection.MsSql,[SecretRotation.Auth0ClientSecret]: AppConnection.Auth0,- [SecretRotation.LdapPassword]: AppConnection.Ldap+ [SecretRotation.LdapPassword]: AppConnection.LDAP};// if a rotation can potentially have downtime due to rotating a single credential set this to falsediff --git a/frontend/src/hooks/api/appConnections/enums.ts b/frontend/src/hooks/api/appConnections/enums.tsindex 419f24a079..b5380affb2 100644--- a/frontend/src/hooks/api/appConnections/enums.ts+++ b/frontend/src/hooks/api/appConnections/enums.ts@@ -13,5 +13,5 @@ export enum AppConnection {Camunda = "camunda",Windmill = "windmill",Auth0 = "auth0",- Ldap = "ldap"+ LDAP = "ldap"}diff --git a/frontend/src/hooks/api/appConnections/types/app-options.ts b/frontend/src/hooks/api/appConnections/types/app-options.tsindex b1f19c7c24..12478aff0a 100644--- a/frontend/src/hooks/api/appConnections/types/app-options.ts+++ b/frontend/src/hooks/api/appConnections/types/app-options.ts@@ -68,7 +68,7 @@ export type TAuth0ConnectionOption = TAppConnectionOptionBase & {};export type TLdapConnectionOption = TAppConnectionOptionBase & {- app: AppConnection.Ldap;+ app: AppConnection.LDAP;};export type TAppConnectionOption =@@ -102,5 +102,5 @@ export type TAppConnectionOptionMap = {[AppConnection.Camunda]: TCamundaConnectionOption;[AppConnection.Windmill]: TWindmillConnectionOption;[AppConnection.Auth0]: TAuth0ConnectionOption;- [AppConnection.Ldap]: TLdapConnectionOption;+ [AppConnection.LDAP]: TLdapConnectionOption;};diff --git a/frontend/src/hooks/api/appConnections/types/index.ts b/frontend/src/hooks/api/appConnections/types/index.tsindex dab5834e48..07cddfed38 100644--- a/frontend/src/hooks/api/appConnections/types/index.ts+++ b/frontend/src/hooks/api/appConnections/types/index.ts@@ -89,5 +89,5 @@ export type TAppConnectionMap = {[AppConnection.Camunda]: TCamundaConnection;[AppConnection.Windmill]: TWindmillConnection;[AppConnection.Auth0]: TAuth0Connection;- [AppConnection.Ldap]: TLdapConnection;+ [AppConnection.LDAP]: TLdapConnection;};diff --git a/frontend/src/hooks/api/appConnections/types/ldap-connection.ts b/frontend/src/hooks/api/appConnections/types/ldap-connection.tsindex 4ce61c4ba5..95165fc5dc 100644--- a/frontend/src/hooks/api/appConnections/types/ldap-connection.ts+++ b/frontend/src/hooks/api/appConnections/types/ldap-connection.ts@@ -9,7 +9,7 @@ export enum LdapConnectionProvider {ActiveDirectory = "active-directory"}-export type TLdapConnection = TRootAppConnection & { app: AppConnection.Ldap } & {+export type TLdapConnection = TRootAppConnection & { app: AppConnection.LDAP } & {method: LdapConnectionMethod.SimpleBind;credentials: {provider: LdapConnectionProvider;diff --git a/frontend/src/hooks/api/secretRotationsV2/types/ldap-password-rotation.ts b/frontend/src/hooks/api/secretRotationsV2/types/ldap-password-rotation.tsindex b5d1c33d97..b8d2ade2b0 100644--- a/frontend/src/hooks/api/secretRotationsV2/types/ldap-password-rotation.ts+++ b/frontend/src/hooks/api/secretRotationsV2/types/ldap-password-rotation.ts@@ -30,7 +30,7 @@ export type TLdapPasswordRotationGeneratedCredentialsResponse =export type TLdapPasswordRotationOption = {name: string;type: SecretRotation.LdapPassword;- connection: AppConnection.Ldap;+ connection: AppConnection.LDAP;template: {secretsMapping: TLdapPasswordRotation["secretsMapping"];};diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsxindex e4c86c03e7..7570eaa142 100644--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx@@ -90,7 +90,7 @@ const CreateForm = ({ app, onComplete }: CreateFormProps) => {return <WindmillConnectionForm onSubmit={onSubmit} />;case AppConnection.Auth0:return <Auth0ConnectionForm onSubmit={onSubmit} />;- case AppConnection.Ldap:+ case AppConnection.LDAP:return <LdapConnectionForm onSubmit={onSubmit} />;default:throw new Error(`Unhandled App ${app}`);@@ -156,7 +156,7 @@ const UpdateForm = ({ appConnection, onComplete }: UpdateFormProps) => {return <WindmillConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;case AppConnection.Auth0:return <Auth0ConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;- case AppConnection.Ldap:+ case AppConnection.LDAP:return <LdapConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;default:throw new Error(`Unhandled App ${(appConnection as TAppConnection).app}`);diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/LdapConnectionFields.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/LdapConnectionFields.tsxindex ccc433895e..308ac6f335 100644--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/LdapConnectionFields.tsx+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/LdapConnectionFields.tsx@@ -37,7 +37,7 @@ type Props = {};const rootSchema = genericAppConnectionFieldsSchema.extend({- app: z.literal(AppConnection.Ldap)+ app: z.literal(AppConnection.LDAP)});const formSchema = z.discriminatedUnion("method", [@@ -45,7 +45,12 @@ const formSchema = z.discriminatedUnion("method", [method: z.literal(LdapConnectionMethod.SimpleBind),credentials: z.object({provider: z.nativeEnum(LdapConnectionProvider),- url: z.string().url().trim().min(1, "LDAP URL required"),+ url: z+ .string()+ .regex(/^ldaps?:\/\//, 'Must start with "ldaps://" or "ldap://"')+ .url()+ .trim()+ .min(1, "LDAP URL required"),dn: z.string().trim().min(1, "Distinguished Name (DN) required"),password: z.string().trim().min(1, "Password required"),sslRejectUnauthorized: z.boolean(),@@ -67,7 +72,7 @@ export const LdapConnectionForm = ({ appConnection, onSubmit }: Props) => {const form = useForm<FormData>({resolver: zodResolver(formSchema),defaultValues: appConnection ?? {- app: AppConnection.Ldap,+ app: AppConnection.LDAP,method: LdapConnectionMethod.SimpleBind,credentials: {provider: LdapConnectionProvider.ActiveDirectory,@@ -88,7 +93,7 @@ export const LdapConnectionForm = ({ appConnection, onSubmit }: Props) => {} = form;const selectedProvider = watch("credentials.provider");- const sslEnabled = watch("credentials.url").startsWith("ldaps://");+ const sslEnabled = watch("credentials.url")?.startsWith("ldaps://") ?? false;return (<FormProvider {...form}>@@ -106,7 +111,7 @@ export const LdapConnectionForm = ({ appConnection, onSubmit }: Props) => {render={({ field: { value, onChange }, fieldState: { error } }) => (<FormControltooltipText={`The method you would like to use to connect with ${- APP_CONNECTION_MAP[AppConnection.Ldap].name+ APP_CONNECTION_MAP[AppConnection.LDAP].name}. This field cannot be changed after creation.`}errorText={error?.message}isError={Boolean(error?.message)}@@ -213,7 +218,7 @@ export const LdapConnectionForm = ({ appConnection, onSubmit }: Props) => {<FormControlerrorText={error?.message}isError={Boolean(error?.message)}- label="Binding Distinguised Name (DN)"+ label="Binding Distinguished Name (DN)"><Input {...field} placeholder="CN=John,OU=Users,DC=example,DC=com" /></FormControl>@@ -263,7 +268,7 @@ export const LdapConnectionForm = ({ appConnection, onSubmit }: Props) => {control={control}render={({ field: { value, onChange }, fieldState: { error } }) => (<FormControl- className={` ${sslEnabled ? "" : "opacity-50"}`}+ className={sslEnabled ? "" : "opacity-50"}isError={Boolean(error?.message)}errorText={error?.message}>