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
import { Controller, useFormContext } from "react-hook-form";
import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
import { Field, FieldError, Input } from "@app/components/v3";
import { SecretRotation, useSecretRotationV2Option } from "@app/hooks/api/secretRotationsV2";
import { SecretsMappingTable } from "./shared";
export const UnixLinuxLocalAccountRotationSecretsMappingFields = () => {
const { control } = useFormContext<
TSecretRotationV2Form & {
type: SecretRotation.UnixLinuxLocalAccount;
}
>();
const { rotationOption } = useSecretRotationV2Option(SecretRotation.UnixLinuxLocalAccount);
const items = [
{
name: "Username",
input: (
<Controller
render={({ field: { value, onChange, onBlur, ref }, fieldState: { error } }) => (
<Field data-invalid={Boolean(error)}>
<Input
ref={ref}
value={value}
onBlur={onBlur}
onChange={onChange}
placeholder={rotationOption?.template.secretsMapping.username}
isError={Boolean(error)}
/>
<FieldError>{error?.message}</FieldError>
</Field>
)}
control={control}
name="secretsMapping.username"
/>
)
},
{
name: "Password",
input: (
<Controller
render={({ field: { value, onChange, onBlur, ref }, fieldState: { error } }) => (
<Field data-invalid={Boolean(error)}>
<Input
ref={ref}
value={value}
onBlur={onBlur}
onChange={onChange}
placeholder={rotationOption?.template.secretsMapping.password}
isError={Boolean(error)}
/>
<FieldError>{error?.message}</FieldError>
</Field>
)}
control={control}
name="secretsMapping.password"
/>
)
}
];
return <SecretsMappingTable items={items} />;
};