Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

add data bag secret field to chef connection form

Dimitris Staratzis5b2a19f657eb
diff --git a/frontend/src/hooks/api/appConnections/types/chef-connection.ts b/frontend/src/hooks/api/appConnections/types/chef-connection.ts
index 371d421999..813a6fd045 100644
--- a/frontend/src/hooks/api/appConnections/types/chef-connection.ts
+++ b/frontend/src/hooks/api/appConnections/types/chef-connection.ts
@@ -12,5 +12,6 @@ export type TChefConnection = TRootAppConnection & { app: AppConnection.Chef } &
orgName: string;
userName: string;
privateKey: string;
+ dataBagSecret?: string;
};
};
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/ChefConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/ChefConnectionForm.tsx
index d28b8713d4..8b14afb63d 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/ChefConnectionForm.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/ChefConnectionForm.tsx
@@ -48,7 +48,12 @@ const formSchema = z.discriminatedUnion("method", [
serverUrl: z.string().trim().url("Valid Chef Server URL required").optional(),
orgName: z.string().trim().min(1, "Organization name required"),
userName: z.string().trim().min(1, "User name required"),
- privateKey: z.string().trim().min(1, "Private key required")
+ privateKey: z.string().trim().min(1, "Private key required"),
+ dataBagSecret: z
+ .string()
+ .trim()
+ .optional()
+ .transform((value) => value || undefined)
})
})
]);
@@ -248,6 +253,35 @@ export const ChefConnectionForm = ({ appConnection, onSubmit }: Props) => {
</Field>
)}
/>
+ <Controller
+ name="credentials.dataBagSecret"
+ control={control}
+ shouldUnregister
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field className="mb-4">
+ <FieldLabel htmlFor="data-bag-secret">
+ Data Bag Secret (optional)
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Info />
+ </TooltipTrigger>
+ <TooltipContent className="max-w-sm">
+ The contents of your encrypted_data_bag_secret file. Needed only for syncs that
+ encrypt secrets. Enter it again whenever you update these credentials.
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
+ <SecretInput
+ aria-describedby={error ? "data-bag-secret-error" : undefined}
+ id="data-bag-secret"
+ isError={Boolean(error)}
+ value={value}
+ onChange={(e) => onChange(e.target.value)}
+ />
+ <FieldError id="data-bag-secret-error" errors={[error]} />
+ </Field>
+ )}
+ />
<AppConnectionFormFooter
submitLabel={isUpdate ? "Update Credentials" : "Connect to Chef"}
/>