Add missing docs for humanitec app connection endpoints

This commit is contained in:
carlosmonastyrski
2025-03-13 15:50:32 -03:00
parent 1d14cdf334
commit f15e61dbd9
15 changed files with 135 additions and 44 deletions
@@ -5,6 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { SecretSyncConnectionField } from "@app/components/secret-syncs/forms/SecretSyncConnectionField";
import { FilterableSelect, FormControl, Select, SelectItem, Tooltip } from "@app/components/v2";
import { HUMANITEC_SYNC_SCOPES } from "@app/helpers/secretSyncs";
import {
THumanitecConnectionApp,
THumanitecConnectionEnvironment,
@@ -41,6 +42,7 @@ export const HumanitecSyncFields = () => {
onChange={() => {
setValue("destinationConfig.org", "");
setValue("destinationConfig.app", "");
setValue("destinationConfig.env", "");
}}
/>
<Controller
@@ -48,11 +50,38 @@ export const HumanitecSyncFields = () => {
control={control}
defaultValue={HumanitecSyncScope.Application}
render={({ field: { value, onChange }, fieldState: { error } }) => (
<FormControl errorText={error?.message} isError={Boolean(error?.message)} label="Scope">
<FormControl
errorText={error?.message}
isError={Boolean(error?.message)}
label="Scope"
tooltipClassName="max-w-lg py-3"
tooltipText={
<div className="flex flex-col gap-3">
<p>
Specify how Infisical should manage secrets from Humanitec. The following options
are available:
</p>
<ul className="flex list-disc flex-col gap-3 pl-4">
{Object.values(HUMANITEC_SYNC_SCOPES).map(({ name, description }) => {
return (
<li key={name}>
<p className="text-mineshaft-300">
<span className="font-medium text-bunker-200">{name}</span>: {description}
</p>
</li>
);
})}
</ul>
</div>
}
>
<Select
value={value}
onValueChange={(val) => {
onChange(val);
setValue("destinationConfig.env", "");
setValue("destinationConfig.app", "");
setValue("destinationConfig.org", "");
}}
className="w-full border border-mineshaft-500 capitalize"
position="popper"
@@ -81,9 +110,11 @@ export const HumanitecSyncFields = () => {
isLoading={isOrganizationsPending && Boolean(connectionId)}
isDisabled={!connectionId}
value={organizations ? (organizations.find((org) => org.id === value) ?? []) : []}
onChange={(option) =>
onChange((option as SingleValue<THumanitecConnectionOrganization>)?.id ?? null)
}
onChange={(option) => {
onChange((option as SingleValue<THumanitecConnectionOrganization>)?.id ?? null);
setValue("destinationConfig.app", "");
setValue("destinationConfig.env", "");
}}
options={organizations}
placeholder="Select an organization..."
getOptionLabel={(option) => option.name}
+17
View File
@@ -4,6 +4,7 @@ import {
SecretSyncImportBehavior,
SecretSyncInitialSyncBehavior
} from "@app/hooks/api/secretSyncs";
import { HumanitecSyncScope } from "@app/hooks/api/secretSyncs/types/humanitec-sync";
export const SECRET_SYNC_MAP: Record<SecretSync, { name: string; image: string }> = {
[SecretSync.AWSParameterStore]: { name: "AWS Parameter Store", image: "Amazon Web Services.png" },
@@ -67,3 +68,19 @@ export const SECRET_SYNC_IMPORT_BEHAVIOR_MAP: Record<
description: `Infisical will import any secrets present in the ${destinationName} destination, prioritizing values from ${destinationName} over Infisical when keys conflict.`
})
};
export const HUMANITEC_SYNC_SCOPES: Record<
HumanitecSyncScope,
{ name: string; description: string }
> = {
[HumanitecSyncScope.Application]: {
name: "Application",
description:
"Infisical will import any secrets present in the selected Humanitec application. This includes all secrets that are not limited to a specific environment."
},
[HumanitecSyncScope.Environment]: {
name: "Environment",
description:
"Infisical will import any secrets present in the selected Humanitec environment. This includes all secrets that are limited to the selected environment."
}
};