Skip to content

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

lock the managed identity fields while the new connection is verified

DimitrisStaratzis3e8bdbab7e17
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AddAppConnectionModal.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AddAppConnectionModal.tsx
index e3f82d7310..e504f47c90 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AddAppConnectionModal.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AddAppConnectionModal.tsx
@@ -138,6 +138,7 @@ export const AddAppConnectionModal = ({
{createdConnection ? (
<AppConnectionForm
appConnection={createdConnection}
+ isNewConnection
onComplete={closeSheet}
onCancel={() => requestDiscardAction(closeSheet)}
onDirtyChange={setIsDirty}
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx
index 35b6728551..30a67479ff 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx
@@ -782,6 +782,7 @@ type Props = {
onDirtyChange?: (isDirty: boolean) => void;
onPendingChange?: (isPending: boolean) => void;
layout?: "sheet" | "dialog";
+ isNewConnection?: boolean;
projectId?: string;
projectType?: ProjectType;
} & Pick<FormProps, "onComplete"> &
@@ -794,6 +795,7 @@ export const AppConnectionForm = ({
onDirtyChange,
onPendingChange,
layout = "sheet",
+ isNewConnection,
projectId,
projectType,
...props
@@ -801,8 +803,8 @@ export const AppConnectionForm = ({
const { app, appConnection } = props;
const contextValue = useMemo(
- () => ({ onCancel, onDirtyChange, onPendingChange, layout }),
- [onCancel, onDirtyChange, onPendingChange, layout]
+ () => ({ onCancel, onDirtyChange, onPendingChange, layout, isNewConnection }),
+ [onCancel, onDirtyChange, onPendingChange, layout, isNewConnection]
);
return (
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionFormContext.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionFormContext.tsx
index b56850dc8d..170473393b 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionFormContext.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionFormContext.tsx
@@ -9,6 +9,8 @@ type AppConnectionFormContextValue = {
onDirtyChange?: (isDirty: boolean) => void;
onPendingChange?: (isPending: boolean) => void;
layout?: "sheet" | "dialog";
+ /** The sheet that created this connection is still open on it, to finish setting it up. */
+ isNewConnection?: boolean;
};
const AppConnectionFormContext = createContext<AppConnectionFormContextValue>({
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureKeyVaultConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureKeyVaultConnectionForm.tsx
index 5e70199ee4..052f54a0c8 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureKeyVaultConnectionForm.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureKeyVaultConnectionForm.tsx
@@ -235,7 +235,7 @@ const getDefaultValues = (appConnection?: TAzureKeyVaultConnection): Partial<For
export const AzureKeyVaultConnectionForm = ({ appConnection, onSubmit, projectId }: Props) => {
const isUpdate = Boolean(appConnection);
- const { onCancel } = useAppConnectionForm();
+ const { onCancel, isNewConnection } = useAppConnectionForm();
const [isRedirecting, setIsRedirecting] = useState(false);
const [hasVerifyFailed, setHasVerifyFailed] = useState(false);
@@ -439,7 +439,7 @@ export const AzureKeyVaultConnectionForm = ({ appConnection, onSubmit, projectId
<TooltipTrigger asChild>
<div>
<GatewayPicker
- isDisabled={!isAllowed}
+ isDisabled={!isAllowed || isNewConnection}
value={{
gatewayId: gatewayId ?? null,
gatewayPoolId: gatewayPoolId ?? null
@@ -718,6 +718,7 @@ export const AzureKeyVaultConnectionForm = ({ appConnection, onSubmit, projectId
setHasVerifyFailed(false);
}}
id="credentials.tenantId"
+ disabled={isNewConnection}
placeholder="00000000-0000-0000-0000-000000000000"
isError={Boolean(error)}
/>
@@ -738,6 +739,7 @@ export const AzureKeyVaultConnectionForm = ({ appConnection, onSubmit, projectId
setHasVerifyFailed(false);
}}
id="credentials.clientId"
+ disabled={isNewConnection}
placeholder="00000000-0000-0000-0000-000000000000"
isError={Boolean(error)}
/>