Lint + form fixes

This commit is contained in:
x032205
2025-07-31 13:21:28 -04:00
parent 1c0caab469
commit 5645dd2b8d
3 changed files with 24 additions and 21 deletions
+1 -1
View File
@@ -143,7 +143,7 @@ In the following steps, we explore how to set up ACME Certificate Authority inte
- **Type**: Select "ACME" as the External CA type. - **Type**: Select "ACME" as the External CA type.
- **Name**: Enter a name for the ACME CA (e.g., "lets-encrypt-production"). - **Name**: Enter a name for the ACME CA (e.g., "lets-encrypt-production").
- **DNS App Connection**: Select from available DNS app connections or configure a new one. This connection provides Infisical with the credentials needed to create and remove DNS records for ACME validation. - **DNS App Connection**: Select from available DNS app connections or configure a new one. This connection provides Infisical with the credentials needed to create and remove DNS records for ACME validation.
- **Zone ID**: Enter your Route53 hosted zone ID (e.g., Z04044I124N1GOOMCOYX1) or select your Cloudflare Zone for the domain(s) you'll be requesting certificates for. - **Zone ID**: Enter the Zone ID for the domain(s) you'll be requesting certificates for.
- **Directory URL**: Enter the ACME v2 directory URL for your chosen CA provider (e.g., `https://acme-v02.api.letsencrypt.org/directory` for Let's Encrypt). - **Directory URL**: Enter the ACME v2 directory URL for your chosen CA provider (e.g., `https://acme-v02.api.letsencrypt.org/directory` for Let's Encrypt).
- **Account Email**: Email address to associate with your ACME account. This email will receive important notifications about your certificates. - **Account Email**: Email address to associate with your ACME account. This email will receive important notifications about your certificates.
- **Enable Direct Issuance**: Toggle on to allow direct certificate issuance without requiring subscribers. - **Enable Direct Issuance**: Toggle on to allow direct certificate issuance without requiring subscribers.
@@ -1,5 +1,6 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { Controller, useForm } from "react-hook-form"; import { Controller, useForm } from "react-hook-form";
import { SingleValue } from "react-select";
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod"; import { z } from "zod";
@@ -16,10 +17,15 @@ import {
Switch Switch
} from "@app/components/v2"; } from "@app/components/v2";
import { useWorkspace } from "@app/context"; import { useWorkspace } from "@app/context";
import { APP_CONNECTION_MAP } from "@app/helpers/appConnections";
import { import {
TAvailableAppConnection, TAvailableAppConnection,
useListAvailableAppConnections useListAvailableAppConnections
} from "@app/hooks/api/appConnections"; } from "@app/hooks/api/appConnections";
import {
TCloudflareZone,
useCloudflareConnectionListZones
} from "@app/hooks/api/appConnections/cloudflare";
import { AppConnection } from "@app/hooks/api/appConnections/enums"; import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { import {
AcmeDnsProvider, AcmeDnsProvider,
@@ -29,18 +35,12 @@ import {
useGetCa, useGetCa,
useUpdateCa useUpdateCa
} from "@app/hooks/api/ca"; } from "@app/hooks/api/ca";
import { UsePopUpState } from "@app/hooks/usePopUp";
import { slugSchema } from "@app/lib/schemas";
import { import {
ACME_DNS_PROVIDER_APP_CONNECTION_MAP, ACME_DNS_PROVIDER_APP_CONNECTION_MAP,
ACME_DNS_PROVIDER_NAME_MAP ACME_DNS_PROVIDER_NAME_MAP
} from "@app/hooks/api/ca/constants"; } from "@app/hooks/api/ca/constants";
import { APP_CONNECTION_MAP } from "@app/helpers/appConnections"; import { UsePopUpState } from "@app/hooks/usePopUp";
import { import { slugSchema } from "@app/lib/schemas";
TCloudflareZone,
useCloudflareConnectionListZones
} from "@app/hooks/api/appConnections/cloudflare";
import { SingleValue } from "react-select";
const schema = z const schema = z
.object({ .object({
@@ -120,12 +120,12 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
const { data: availableRoute53Connections, isPending: isRoute53Pending } = const { data: availableRoute53Connections, isPending: isRoute53Pending } =
useListAvailableAppConnections(AppConnection.AWS, { useListAvailableAppConnections(AppConnection.AWS, {
enabled: dnsProvider === AcmeDnsProvider.ROUTE53 enabled: caType === CaType.ACME
}); });
const { data: availableCloudflareConnections, isPending: isCloudflarePending } = const { data: availableCloudflareConnections, isPending: isCloudflarePending } =
useListAvailableAppConnections(AppConnection.Cloudflare, { useListAvailableAppConnections(AppConnection.Cloudflare, {
enabled: dnsProvider === AcmeDnsProvider.Cloudflare enabled: caType === CaType.ACME
}); });
const availableConnections: TAvailableAppConnection[] = [ const availableConnections: TAvailableAppConnection[] = [
@@ -135,11 +135,11 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
const isPending = isRoute53Pending || isCloudflarePending; const isPending = isRoute53Pending || isCloudflarePending;
const connection = watch("configuration.dnsAppConnection"); const dnsAppConnection = watch("configuration.dnsAppConnection");
const { data: cloudflareZones = [], isPending: isZonesPending } = const { data: cloudflareZones = [], isPending: isZonesPending } =
useCloudflareConnectionListZones(connection.id, { useCloudflareConnectionListZones(dnsAppConnection.id, {
enabled: dnsProvider === AcmeDnsProvider.Cloudflare && !!connection.id enabled: dnsProvider === AcmeDnsProvider.Cloudflare && !!dnsAppConnection.id
}); });
useEffect(() => { useEffect(() => {
@@ -328,7 +328,7 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
control={control} control={control}
name="configuration.dnsAppConnection" name="configuration.dnsAppConnection"
/> />
{dnsProvider === AcmeDnsProvider.ROUTE53 ? ( {dnsProvider === AcmeDnsProvider.ROUTE53 && (
<Controller <Controller
control={control} control={control}
defaultValue="" defaultValue=""
@@ -344,7 +344,8 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
</FormControl> </FormControl>
)} )}
/> />
) : dnsProvider === AcmeDnsProvider.Cloudflare ? ( )}
{dnsProvider === AcmeDnsProvider.Cloudflare && (
<Controller <Controller
name="configuration.dnsProviderConfig.hostedZoneId" name="configuration.dnsProviderConfig.hostedZoneId"
control={control} control={control}
@@ -355,8 +356,8 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
label="Zone" label="Zone"
> >
<FilterableSelect <FilterableSelect
isLoading={isZonesPending && !!connection.id} isLoading={isZonesPending && !!dnsAppConnection.id}
isDisabled={!connection.id} isDisabled={!dnsAppConnection.id}
value={cloudflareZones.find((zone) => zone.id === value)} value={cloudflareZones.find((zone) => zone.id === value)}
onChange={(option) => { onChange={(option) => {
onChange((option as SingleValue<TCloudflareZone>)?.id ?? null); onChange((option as SingleValue<TCloudflareZone>)?.id ?? null);
@@ -369,8 +370,6 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
</FormControl> </FormControl>
)} )}
/> />
) : (
<></>
)} )}
<Controller <Controller
control={control} control={control}
@@ -82,7 +82,11 @@ export const SecretDetectionIgnoreValuesSection = () => {
<div className="flex w-full items-center justify-between"> <div className="flex w-full items-center justify-between">
<p className="text-xl font-semibold">Secret Detection</p> <p className="text-xl font-semibold">Secret Detection</p>
</div> </div>
<p className="mb-4 mt-2 max-w-2xl text-sm text-gray-400">Define secret values to ignore when scanning designated parameter folders. Add values here to prevent false positives or allow approved sensitive data. These ignored values will not trigger policy violation alerts.</p> <p className="mb-4 mt-2 max-w-2xl text-sm text-gray-400">
Define secret values to ignore when scanning designated parameter folders. Add values here
to prevent false positives or allow approved sensitive data. These ignored values will not
trigger policy violation alerts.
</p>
<form onSubmit={handleSubmit(handleIgnoreValuesSubmit)} autoComplete="off"> <form onSubmit={handleSubmit(handleIgnoreValuesSubmit)} autoComplete="off">
<div className="mb-4"> <div className="mb-4">