Skip to content

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

improvements: address feedback

Scott Wilson1e5244b2c3cb
diff --git a/backend/src/services/app-connection/app-connection-fns.ts b/backend/src/services/app-connection/app-connection-fns.ts
index bfad05213c..f88b5a3574 100644
--- a/backend/src/services/app-connection/app-connection-fns.ts
+++ b/backend/src/services/app-connection/app-connection-fns.ts
@@ -149,6 +149,9 @@ const SECRET_SCANNING_APP_CONNECTION_MAP = Object.fromEntries(
Object.entries(SECRET_SCANNING_DATA_SOURCE_CONNECTION_MAP).map(([key, value]) => [value, key])
);
+// scott: ideally this would be derived from a utilized map like the above
+const PKI_APP_CONNECTIONS = [AppConnection.AWS, AppConnection.Cloudflare, AppConnection.AzureADCS];
+
export const listAppConnectionOptions = (projectType?: ProjectType) => {
return [
getAwsConnectionListItem(),
@@ -200,11 +203,7 @@ export const listAppConnectionOptions = (projectType?: ProjectType) => {
case ProjectType.SecretScanning:
return Boolean(SECRET_SCANNING_APP_CONNECTION_MAP[option.app]);
case ProjectType.CertificateManager:
- return (
- option.app === AppConnection.AWS ||
- option.app === AppConnection.Cloudflare ||
- option.app === AppConnection.AzureADCS
- );
+ return PKI_APP_CONNECTIONS.includes(option.app);
case ProjectType.KMS:
return false;
case ProjectType.SSH:
diff --git a/frontend/src/components/secret-rotations-v2/CreateSecretRotationV2Modal.tsx b/frontend/src/components/secret-rotations-v2/CreateSecretRotationV2Modal.tsx
index 9666c3c52e..89ced26b7b 100644
--- a/frontend/src/components/secret-rotations-v2/CreateSecretRotationV2Modal.tsx
+++ b/frontend/src/components/secret-rotations-v2/CreateSecretRotationV2Modal.tsx
@@ -27,18 +27,20 @@ type ContentProps = {
selectedRotation: SecretRotation | null;
setSelectedRotation: (selectedRotation: SecretRotation | null) => void;
initialFormData?: Partial<TSecretRotationV2Form>;
+ onCancel: () => void;
} & SharedProps;
const Content = ({
setSelectedRotation,
selectedRotation,
initialFormData,
+ onCancel,
...props
}: ContentProps) => {
if (selectedRotation) {
return (
<SecretRotationV2Form
- onCancel={() => setSelectedRotation(null)}
+ onCancel={onCancel}
type={selectedRotation}
initialFormData={initialFormData}
{...props}
@@ -93,13 +95,17 @@ export const CreateSecretRotationV2Modal = ({ onOpenChange, isOpen, ...props }:
}
}, [connectionId, connectionName]);
+ const handleReset = () => {
+ setSelectedRotation(null);
+ setInitialFormData(undefined);
+ };
+
return (
<Modal
isOpen={isOpen}
onOpenChange={(open) => {
if (!open) {
- setSelectedRotation(null);
- setInitialFormData(undefined);
+ handleReset();
}
onOpenChange(open);
}}
@@ -137,9 +143,10 @@ export const CreateSecretRotationV2Modal = ({ onOpenChange, isOpen, ...props }:
>
<Content
onComplete={() => {
- setSelectedRotation(null);
+ handleReset();
onOpenChange(false);
}}
+ onCancel={handleReset}
initialFormData={initialFormData}
selectedRotation={selectedRotation}
setSelectedRotation={setSelectedRotation}
diff --git a/frontend/src/components/secret-scanning/CreateSecretScanningDataSourceModal.tsx b/frontend/src/components/secret-scanning/CreateSecretScanningDataSourceModal.tsx
index 520aa0365c..fb1081d020 100644
--- a/frontend/src/components/secret-scanning/CreateSecretScanningDataSourceModal.tsx
+++ b/frontend/src/components/secret-scanning/CreateSecretScanningDataSourceModal.tsx
@@ -24,16 +24,18 @@ type ContentProps = {
selectedDataSource: SecretScanningDataSource | null;
setSelectedDataSource: (selectedDataSource: SecretScanningDataSource | null) => void;
initialFormData?: Partial<TSecretScanningDataSourceForm>;
+ onCancel: () => void;
};
-const Content = ({ setSelectedDataSource, selectedDataSource, ...props }: ContentProps) => {
+const Content = ({
+ setSelectedDataSource,
+ selectedDataSource,
+ onCancel,
+ ...props
+}: ContentProps) => {
if (selectedDataSource) {
return (
- <SecretScanningDataSourceForm
- onCancel={() => setSelectedDataSource(null)}
- type={selectedDataSource}
- {...props}
- />
+ <SecretScanningDataSourceForm onCancel={onCancel} type={selectedDataSource} {...props} />
);
}
@@ -86,11 +88,18 @@ export const CreateSecretScanningDataSourceModal = ({ onOpenChange, isOpen, ...p
}
}, [connectionId, connectionName]);
+ const resetModal = () => {
+ setSelectedDataSource(null);
+ setInitialFormData(undefined);
+ };
+
return (
<Modal
isOpen={isOpen}
onOpenChange={(open) => {
- if (!open) setSelectedDataSource(null);
+ if (!open) {
+ resetModal();
+ }
onOpenChange(open);
}}
>
@@ -127,9 +136,10 @@ export const CreateSecretScanningDataSourceModal = ({ onOpenChange, isOpen, ...p
>
<Content
onComplete={() => {
- setSelectedDataSource(null);
+ resetModal();
onOpenChange(false);
}}
+ onCancel={resetModal}
selectedDataSource={selectedDataSource}
setSelectedDataSource={setSelectedDataSource}
initialFormData={initialFormData}
diff --git a/frontend/src/pages/public/ErrorPage/components/ProjectAccessError.tsx b/frontend/src/pages/public/ErrorPage/components/ProjectAccessError.tsx
index 95a7d3729e..d6fd57d562 100644
--- a/frontend/src/pages/public/ErrorPage/components/ProjectAccessError.tsx
+++ b/frontend/src/pages/public/ErrorPage/components/ProjectAccessError.tsx
@@ -8,7 +8,6 @@ import { RequestProjectAccessModal } from "@app/components/projects";
import { AccessRestrictedBanner, Button } from "@app/components/v2";
import { OrgPermissionSubjects } from "@app/context";
import { OrgPermissionAdminConsoleAction } from "@app/context/OrgPermissionContext/types";
-import { getProjectHomePage } from "@app/helpers/project";
import { usePopUp } from "@app/hooks";
import { useOrgAdminAccessProject, useSearchProjects } from "@app/hooks/api";
@@ -41,10 +40,7 @@ export const ProjectAccessError = () => {
projectId: project.id
});
await navigate({
- to: getProjectHomePage(project.type, project.environments),
- params: {
- projectId: project.id
- }
+ to: "."
});
} catch {
createNotification({