Skip to content

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

merge main

Scott Wilsonfeb234ddcc48
diff --cc frontend/src/components/projects/RequestProjectAccessModal.tsx
index a0c5de76fe,0000000000..6d31bf8e62
mode 100644,000000..100644
--- a/frontend/src/components/projects/RequestProjectAccessModal.tsx
+++ b/frontend/src/components/projects/RequestProjectAccessModal.tsx
@@@ -1,88 -1,0 +1,88 @@@
+import { useForm } from "react-hook-form";
+
+import { createNotification } from "@app/components/notifications";
+import { Button, FormControl, Input, Modal, ModalClose, ModalContent } from "@app/components/v2";
+import { useRequestProjectAccess } from "@app/hooks/api";
- import { Workspace } from "@app/hooks/api/workspace/types";
++import { Project } from "@app/hooks/api/projects/types";
+
+type ContentProps = {
+ projectId: string;
+ onComplete: () => void;
+};
+
+const Content = ({ projectId, onComplete }: ContentProps) => {
+ const form = useForm<{ note: string }>();
+
+ const requestProjectAccess = useRequestProjectAccess();
+
+ const onFormSubmit = ({ note }: { note: string }) => {
+ if (requestProjectAccess.isPending) return;
+ requestProjectAccess.mutate(
+ {
+ comment: note,
+ projectId
+ },
+ {
+ onSuccess: () => {
+ createNotification({
+ type: "success",
+ title: "Project Access Request Sent",
+ text: "Project admins will receive an email of your request"
+ });
+ onComplete();
+ }
+ }
+ );
+ };
+
+ return (
+ <form onSubmit={form.handleSubmit(onFormSubmit)}>
+ <FormControl label="Note">
+ <Input {...form.register("note")} />
+ </FormControl>
+ <div className="mt-4 flex items-center">
+ <Button className="mr-4" size="sm" type="submit" isLoading={form.formState.isSubmitting}>
+ Submit Request
+ </Button>
+ <ModalClose asChild>
+ <Button colorSchema="secondary" variant="plain">
+ Cancel
+ </Button>
+ </ModalClose>
+ </div>
+ </form>
+ );
+};
+
+type RequestProjectAccessModalProps = {
+ isOpen: boolean;
+ onOpenChange: (isOpen: boolean) => void;
- project?: Workspace;
++ project?: Project;
+ onComplete?: () => void;
+};
+
+export const RequestProjectAccessModal = ({
+ isOpen,
+ onOpenChange,
+ project,
+ onComplete
+}: RequestProjectAccessModalProps) => {
+ if (!project) return null;
+
+ return (
+ <Modal isOpen={isOpen} onOpenChange={onOpenChange}>
+ <ModalContent
+ title="Confirm Access Request"
+ subTitle={`Requesting access to project ${project?.name}. You may include an optional note for project admins to review your request.`}
+ >
+ <Content
+ onComplete={() => {
+ onOpenChange(false);
+ if (onComplete) onComplete();
+ }}
+ projectId={project?.id}
+ />
+ </ModalContent>
+ </Modal>
+ );
+};
diff --cc frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ConnectionField.tsx
index 407a473d1e,665ab05a63..c2064071f6
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ConnectionField.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ConnectionField.tsx
@@@ -1,17 -1,14 +1,17 @@@
import { Controller, useFormContext } from "react-hook-form";
+import { SingleValue } from "react-select";
import { faInfoCircle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { Link } from "@tanstack/react-router";
+import { AppConnectionOption } from "@app/components/app-connections";
import { FilterableSelect, FormControl } from "@app/components/v2";
- import { ProjectPermissionSub, useProjectPermission, useWorkspace } from "@app/context";
-import { OrgPermissionSubjects, useOrgPermission } from "@app/context";
-import { OrgPermissionAppConnectionActions } from "@app/context/OrgPermissionContext/types";
++import { ProjectPermissionSub, useProject, useProjectPermission } from "@app/context";
+import { ProjectPermissionAppConnectionActions } from "@app/context/ProjectPermissionContext/types";
import { APP_CONNECTION_MAP } from "@app/helpers/appConnections";
import { SECRET_ROTATION_CONNECTION_MAP } from "@app/helpers/secretRotationsV2";
+import { usePopUp } from "@app/hooks";
import { useListAvailableAppConnections } from "@app/hooks/api/appConnections";
+import { AddAppConnectionModal } from "@app/pages/organization/AppConnections/AppConnectionsPage/components";
import { TSecretRotationV2Form } from "./schemas";
@@@ -29,12 -24,7 +29,12 @@@ export const SecretRotationV2Connection
const rotationType = watch("type");
const app = SECRET_ROTATION_CONNECTION_MAP[rotationType];
- const { currentWorkspace } = useWorkspace();
- const { data: availableConnections, isPending } = useListAvailableAppConnections(app);
++ const { currentProject } = useProject();
+
+ const { data: availableConnections, isPending } = useListAvailableAppConnections(
+ app,
- currentWorkspace.id
++ currentProject.id
+ );
const connectionName = APP_CONNECTION_MAP[app].name;
@@@ -104,28 -81,22 +104,28 @@@
control={control}
name="connection"
/>
- {!isUpdate && availableConnections?.length === 0 && (
+ {!isUpdate && !isPending && !availableConnections?.length && !canCreateConnection && (
<p className="-mt-2.5 mb-2.5 text-xs text-yellow">
<FontAwesomeIcon className="mr-1" size="xs" icon={faInfoCircle} />
- {canCreateConnection ? (
- <>
- You do not have access to any {appName} Connections. Create one from the{" "}
- <Link to="/organization/app-connections" className="underline">
- App Connections
- </Link>{" "}
- page.
- </>
- ) : (
- `You do not have access to any ${appName} Connections. Contact an admin to create one.`
- )}
+ You do not have access to any {appName} Connections. Contact an admin to create one.
</p>
)}
+ <AddAppConnectionModal
+ isOpen={popUp.addConnection.isOpen}
+ onOpenChange={(isOpen) => {
+ // remove form storage, not oauth connection
+ localStorage.removeItem("secretRotationFormData");
+ handlePopUpToggle("addConnection", isOpen);
+ }}
- projectType={currentWorkspace.type}
- projectId={currentWorkspace.id}
++ projectType={currentProject.type}
++ projectId={currentProject.id}
+ app={app}
+ onComplete={(connection) => {
+ if (connection) {
+ setValue("connection", connection);
+ }
+ }}
+ />
</>
);
};
diff --cc frontend/src/components/secret-rotations-v2/forms/SecretRotationV2Form.tsx
index 62efaa8d2c,82cf3a30aa..87869e9255
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2Form.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2Form.tsx
@@@ -32,9 -32,8 +32,9 @@@ type Props =
onCancel: () => void;
secretPath: string;
environment?: string;
- environments?: WorkspaceEnv[];
+ environments?: ProjectEnv[];
secretRotation?: TSecretRotationV2;
+ initialFormData?: Partial<TSecretRotationV2Form>;
};
const FORM_TABS: { name: string; key: string; fields: (keyof TSecretRotationV2Form)[] }[] = [
@@@ -93,10 -91,9 +93,10 @@@ export const SecretRotationV2Form = (
hours: 0,
minutes: 0
},
- environment: currentWorkspace?.environments.find((env) => env.slug === envSlug),
+ environment: currentProject?.environments.find((env) => env.slug === envSlug),
secretPath,
- ...(rotationOption!.template as object) // can't infer type since we don't know which specific type it is
+ ...((rotationOption?.template as object) ?? {}), // can't infer type since we don't know which specific type it is
+ ...(initialFormData as object)
},
reValidateMode: "onChange"
});
diff --cc frontend/src/components/secret-scanning/forms/SecretScanningDataSourceConnectionField.tsx
index a58908da5a,3f995e1d0e..2e9e4a2a5b
--- a/frontend/src/components/secret-scanning/forms/SecretScanningDataSourceConnectionField.tsx
+++ b/frontend/src/components/secret-scanning/forms/SecretScanningDataSourceConnectionField.tsx
@@@ -1,17 -1,14 +1,17 @@@
import { Controller, useFormContext } from "react-hook-form";
+import { SingleValue } from "react-select";
import { faInfoCircle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { Link } from "@tanstack/react-router";
+import { AppConnectionOption } from "@app/components/app-connections";
import { FilterableSelect, FormControl } from "@app/components/v2";
- import { ProjectPermissionSub, useProjectPermission, useWorkspace } from "@app/context";
-import { OrgPermissionSubjects, useOrgPermission } from "@app/context";
-import { OrgPermissionAppConnectionActions } from "@app/context/OrgPermissionContext/types";
++import { ProjectPermissionSub, useProject, useProjectPermission } from "@app/context";
+import { ProjectPermissionAppConnectionActions } from "@app/context/ProjectPermissionContext/types";
import { APP_CONNECTION_MAP } from "@app/helpers/appConnections";
import { SECRET_SCANNING_DATA_SOURCE_CONNECTION_MAP } from "@app/helpers/secretScanningV2";
+import { usePopUp } from "@app/hooks";
import { useListAvailableAppConnections } from "@app/hooks/api/appConnections";
+import { AddAppConnectionModal } from "@app/pages/organization/AppConnections/AppConnectionsPage/components";
import { TSecretScanningDataSourceForm } from "./schemas";
@@@ -32,12 -27,7 +32,12 @@@ export const SecretScanningDataSourceCo
const dataSourceType = watch("type");
const app = SECRET_SCANNING_DATA_SOURCE_CONNECTION_MAP[dataSourceType];
- const { currentWorkspace } = useWorkspace();
- const { data: availableConnections, isPending } = useListAvailableAppConnections(app);
++ const { currentProject } = useProject();
+
+ const { data: availableConnections, isPending } = useListAvailableAppConnections(
+ app,
- currentWorkspace.id
++ currentProject.id
+ );
const connectionName = APP_CONNECTION_MAP[app].name;
@@@ -105,29 -82,22 +105,29 @@@
control={control}
name="connection"
/>
- {!isUpdate && availableConnections?.length === 0 && (
+ {!isUpdate && !isPending && !availableConnections?.length && !canCreateConnection && (
<p className="-mt-2.5 mb-2.5 text-xs text-yellow">
<FontAwesomeIcon className="mr-1" size="xs" icon={faInfoCircle} />
- {canCreateConnection ? (
- <>
- You do not have access to any {connectionName} Connections. Create one from the{" "}
- <Link to="/organization/app-connections" className="underline">
- App Connections
- </Link>{" "}
- page.
- </>
- ) : (
- `You do not have access to any ${connectionName} Connections. Contact an admin to create one.`
- )}
+ You do not have access to any {connectionName} Connections. Contact an admin to create
+ one.
</p>
)}
+ <AddAppConnectionModal
+ isOpen={popUp.addConnection.isOpen}
+ onOpenChange={(isOpen) => {
+ // remove form storage, not oauth connection
+ localStorage.removeItem("secretScanningDataSourceFormData");
+ handlePopUpToggle("addConnection", isOpen);
+ }}
- projectType={currentWorkspace.type}
- projectId={currentWorkspace.id}
++ projectType={currentProject.type}
++ projectId={currentProject.id}
+ app={app}
+ onComplete={(connection) => {
+ if (connection) {
+ setValue("connection", connection);
+ }
+ }}
+ />
</>
);
};
diff --cc frontend/src/components/secret-scanning/forms/SecretScanningDataSourceForm.tsx
index 49568dfece,948cfcdc12..515a674369
--- a/frontend/src/components/secret-scanning/forms/SecretScanningDataSourceForm.tsx
+++ b/frontend/src/components/secret-scanning/forms/SecretScanningDataSourceForm.tsx
@@@ -37,16 -36,10 +37,16 @@@ const FORM_TABS: { name: string; key: s
{ name: "Review", key: "review", fields: [] }
];
-export const SecretScanningDataSourceForm = ({ type, onComplete, onCancel, dataSource }: Props) => {
+export const SecretScanningDataSourceForm = ({
+ type,
+ onComplete,
+ onCancel,
+ dataSource,
+ initialFormData
+}: Props) => {
const createDataSource = useCreateSecretScanningDataSource();
const updateDataSource = useUpdateSecretScanningDataSource();
- const { currentWorkspace } = useWorkspace();
+ const { currentProject } = useProject();
const { name: sourceType } = SECRET_SCANNING_DATA_SOURCE_MAP[type];
const [selectedTabIndex, setSelectedTabIndex] = useState(0);
diff --cc frontend/src/components/secret-syncs/forms/CreateSecretSyncForm.tsx
index 082054ad29,8e5a0ebf4a..4135a9926f
--- a/frontend/src/components/secret-syncs/forms/CreateSecretSyncForm.tsx
+++ b/frontend/src/components/secret-syncs/forms/CreateSecretSyncForm.tsx
@@@ -40,14 -39,9 +40,14 @@@ const FORM_TABS: { name: string; key: s
{ name: "Review", key: "review", fields: [] }
];
-export const CreateSecretSyncForm = ({ destination, onComplete, onCancel }: Props) => {
+export const CreateSecretSyncForm = ({
+ destination,
+ onComplete,
+ onCancel,
+ initialFormData
+}: Props) => {
const createSecretSync = useCreateSecretSync();
- const { currentWorkspace } = useWorkspace();
+ const { currentProject } = useProject();
const { name: destinationName } = SECRET_SYNC_MAP[destination];
const [showConfirmation, setShowConfirmation] = useState(false);
diff --cc frontend/src/components/secret-syncs/forms/SecretSyncConnectionField.tsx
index 290f36206e,94e5877091..62542a5702
--- a/frontend/src/components/secret-syncs/forms/SecretSyncConnectionField.tsx
+++ b/frontend/src/components/secret-syncs/forms/SecretSyncConnectionField.tsx
@@@ -1,17 -1,14 +1,17 @@@
import { Controller, useFormContext } from "react-hook-form";
+import { SingleValue } from "react-select";
import { faInfoCircle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { Link } from "@tanstack/react-router";
+import { AppConnectionOption } from "@app/components/app-connections";
import { FilterableSelect, FormControl } from "@app/components/v2";
- import { ProjectPermissionSub, useProjectPermission, useWorkspace } from "@app/context";
-import { OrgPermissionSubjects, useOrgPermission } from "@app/context";
-import { OrgPermissionAppConnectionActions } from "@app/context/OrgPermissionContext/types";
++import { ProjectPermissionSub, useProject, useProjectPermission } from "@app/context";
+import { ProjectPermissionAppConnectionActions } from "@app/context/ProjectPermissionContext/types";
import { APP_CONNECTION_MAP } from "@app/helpers/appConnections";
import { SECRET_SYNC_CONNECTION_MAP } from "@app/helpers/secretSyncs";
+import { usePopUp } from "@app/hooks";
import { useListAvailableAppConnections } from "@app/hooks/api/appConnections";
+import { AddAppConnectionModal } from "@app/pages/organization/AppConnections/AppConnectionsPage/components";
import { TSecretSyncForm } from "./schemas";
@@@ -28,12 -23,7 +28,12 @@@ export const SecretSyncConnectionField
const destination = watch("destination");
const app = SECRET_SYNC_CONNECTION_MAP[destination];
- const { currentWorkspace } = useWorkspace();
- const { data: availableConnections, isPending } = useListAvailableAppConnections(app);
++ const { currentProject } = useProject();
+
+ const { data: availableConnections, isPending } = useListAvailableAppConnections(
+ app,
- currentWorkspace.id
++ currentProject.id
+ );
const connectionName = APP_CONNECTION_MAP[app].name;
@@@ -88,28 -65,22 +88,28 @@@
control={control}
name="connection"
/>
- {availableConnections?.length === 0 && (
+ {!isPending && !availableConnections?.length && !canCreateConnection && (
<p className="-mt-2.5 mb-2.5 text-xs text-yellow">
<FontAwesomeIcon className="mr-1" size="xs" icon={faInfoCircle} />
- {canCreateConnection ? (
- <>
- You do not have access to any {appName} Connections. Create one from the{" "}
- <Link to="/organization/app-connections" className="underline">
- App Connections
- </Link>{" "}
- page.
- </>
- ) : (
- `You do not have access to any ${appName} Connections. Contact an admin to create one.`
- )}
+ You do not have access to any {appName} Connections. Contact an admin to create one.
</p>
)}
+ <AddAppConnectionModal
+ isOpen={popUp.addConnection.isOpen}
+ onOpenChange={(isOpen) => {
+ // remove form storage, not oauth connection
+ localStorage.removeItem("secretSyncFormData");
+ handlePopUpToggle("addConnection", isOpen);
+ }}
- projectType={currentWorkspace.type}
- projectId={currentWorkspace.id}
++ projectType={currentProject.type}
++ projectId={currentProject.id}
+ app={app}
+ onComplete={(connection) => {
+ if (connection) {
+ setValue("connection", connection);
+ }
+ }}
+ />
</>
);
};
diff --cc frontend/src/hooks/api/appConnections/queries.tsx
index 48c084a4e9,dbccade88c..a27ffdc107
--- a/frontend/src/hooks/api/appConnections/queries.tsx
+++ b/frontend/src/hooks/api/appConnections/queries.tsx
@@@ -14,7 -16,6 +14,7 @@@ import
TAppConnectionOption,
TAppConnectionOptionMap
} from "@app/hooks/api/appConnections/types/app-options";
- import { ProjectType } from "@app/hooks/api/workspace/types";
++import { ProjectType } from "@app/hooks/api/projects/types";
export const appConnectionKeys = {
all: ["app-connection"] as const,
diff --cc frontend/src/hooks/api/appConnections/types/root-connection.ts
index 3a90ca12b9,5b8f5cd023..96198265e1
--- a/frontend/src/hooks/api/appConnections/types/root-connection.ts
+++ b/frontend/src/hooks/api/appConnections/types/root-connection.ts
@@@ -1,5 -1,3 +1,5 @@@
- import { ProjectType } from "@app/hooks/api/workspace/types";
++import { ProjectType } from "@app/hooks/api/projects/types";
+
export type TRootAppConnection = {
id: string;
name: string;
diff --cc frontend/src/layouts/PkiManagerLayout/PkiManagerLayout.tsx
index 4e17e4b17a,438050ad2f..ec47273309
--- a/frontend/src/layouts/PkiManagerLayout/PkiManagerLayout.tsx
+++ b/frontend/src/layouts/PkiManagerLayout/PkiManagerLayout.tsx
@@@ -131,23 -130,6 +131,23 @@@ export const PkiManagerLayout = () =>
</MenuItem>
)}
</Link>
+ <Link
+ to="/projects/cert-management/$projectId/app-connections"
+ params={{
- projectId: currentWorkspace.id
++ projectId: currentProject.id
+ }}
+ >
+ {({ isActive }) => (
+ <MenuItem isSelected={isActive}>
+ <div className="mx-1 flex gap-2">
+ <div className="w-6">
+ <FontAwesomeIcon icon={faPlug} />
+ </div>
+ App Connections
+ </div>
+ </MenuItem>
+ )}
+ </Link>
</MenuGroup>
<MenuGroup title="Others">
<Link
diff --cc frontend/src/layouts/SecretManagerLayout/SecretManagerLayout.tsx
index d85176a019,d2b7294490..0b9b934c37
--- a/frontend/src/layouts/SecretManagerLayout/SecretManagerLayout.tsx
+++ b/frontend/src/layouts/SecretManagerLayout/SecretManagerLayout.tsx
@@@ -160,23 -158,6 +159,23 @@@ export const SecretManagerLayout = () =
</MenuItem>
)}
</Link>
+ <Link
+ to="/projects/secret-management/$projectId/app-connections"
+ params={{
- projectId: currentWorkspace.id
++ projectId: currentProject.id
+ }}
+ >
+ {({ isActive }) => (
+ <MenuItem isSelected={isActive}>
+ <div className="mx-1 flex gap-2">
+ <div className="w-6">
+ <FontAwesomeIcon icon={faPlug} />
+ </div>
+ App Connections
+ </div>
+ </MenuItem>
+ )}
+ </Link>
</MenuGroup>
<MenuGroup title="Others">
<Link
diff --cc frontend/src/layouts/SecretScanningLayout/SecretScanningLayout.tsx
index b84b33cabf,b6313acbff..af7bba5d1b
--- a/frontend/src/layouts/SecretScanningLayout/SecretScanningLayout.tsx
+++ b/frontend/src/layouts/SecretScanningLayout/SecretScanningLayout.tsx
@@@ -101,23 -100,6 +101,23 @@@ export const SecretScanningLayout = ()
</MenuItem>
)}
</Link>
+ <Link
+ to="/projects/secret-scanning/$projectId/app-connections"
+ params={{
- projectId: currentWorkspace.id
++ projectId: currentProject.id
+ }}
+ >
+ {({ isActive }) => (
+ <MenuItem isSelected={isActive}>
+ <div className="mx-1 flex gap-2">
+ <div className="w-6">
+ <FontAwesomeIcon icon={faPlug} />
+ </div>
+ App Connections
+ </div>
+ </MenuItem>
+ )}
+ </Link>
</MenuGroup>
<MenuGroup title="Others">
<Link
diff --cc frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaModal.tsx
index 4378379801,ed9c6b9e9e..5e7ab5cdd6
--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaModal.tsx
+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaModal.tsx
@@@ -202,17 -201,17 +202,17 @@@ export const ExternalCaModal = ({ popUp
}, [popUp?.ca?.isOpen, popUp?.ca?.data, reset, ca]);
const { data: availableRoute53Connections, isPending: isRoute53Pending } =
- useListAvailableAppConnections(AppConnection.AWS, currentWorkspace.id, {
- useListAvailableAppConnections(AppConnection.AWS, {
++ useListAvailableAppConnections(AppConnection.AWS, currentProject.id, {
enabled: caType === CaType.ACME
});
const { data: availableCloudflareConnections, isPending: isCloudflarePending } =
- useListAvailableAppConnections(AppConnection.Cloudflare, currentWorkspace.id, {
- useListAvailableAppConnections(AppConnection.Cloudflare, {
++ useListAvailableAppConnections(AppConnection.Cloudflare, currentProject.id, {
enabled: caType === CaType.ACME
});
const { data: availableAzureConnections, isPending: isAzurePending } =
- useListAvailableAppConnections(AppConnection.AzureADCS, currentWorkspace.id, {
- useListAvailableAppConnections(AppConnection.AzureADCS, {
++ useListAvailableAppConnections(AppConnection.AzureADCS, currentProject.id, {
enabled: caType === CaType.AZURE_AD_CS
});
diff --cc frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AddAppConnectionModal.tsx
index bcea6b5300,c74985a3f8..c52f89dc9b
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AddAppConnectionModal.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AddAppConnectionModal.tsx
@@@ -3,7 -3,6 +3,7 @@@ import { useState } from "react"
import { Modal, ModalContent } from "@app/components/v2";
import { TAppConnection } from "@app/hooks/api/appConnections";
import { AppConnection } from "@app/hooks/api/appConnections/enums";
- import { ProjectType } from "@app/hooks/api/workspace/types";
++import { ProjectType } from "@app/hooks/api/projects/types";
import { AppConnectionForm } from "./AppConnectionForm";
import { AppConnectionsSelect } from "./AppConnectionList";
diff --cc frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionList.tsx
index 3170ad07fc,2087ebf633..0137d5a9e0
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionList.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionList.tsx
@@@ -9,7 -9,6 +9,7 @@@ import { APP_CONNECTION_MAP } from "@ap
import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
import { useAppConnectionOptions } from "@app/hooks/api/appConnections";
import { AppConnection } from "@app/hooks/api/appConnections/enums";
- import { ProjectType } from "@app/hooks/api/workspace/types";
++import { ProjectType } from "@app/hooks/api/projects/types";
type Props = {
onSelect: (app: AppConnection) => void;
diff --cc frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionsTable.tsx
index 9b24312bc1,bc448663a3..91ad35d4a3
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionsTable.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionsTable.tsx
@@@ -47,9 -39,7 +47,9 @@@ import { usePagination, usePopUp, useRe
import { TAppConnection, useListAppConnections } from "@app/hooks/api/appConnections";
import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { OrderByDirection } from "@app/hooks/api/generic/types";
- import { ProjectType } from "@app/hooks/api/workspace/types";
++import { ProjectType } from "@app/hooks/api/projects/types";
+import { AddAppConnectionModal } from "./AddAppConnectionModal";
import { AppConnectionRow } from "./AppConnectionRow";
import { DeleteAppConnectionModal } from "./DeleteAppConnectionModal";
import { EditAppConnectionCredentialsModal } from "./EditAppConnectionCredentialsModal";
diff --cc frontend/src/pages/organization/ProjectsPage/components/AllProjectView.tsx
index d5c91d810e,a1b74656f4..f7d20e2b7f
--- a/frontend/src/pages/organization/ProjectsPage/components/AllProjectView.tsx
+++ b/frontend/src/pages/organization/ProjectsPage/components/AllProjectView.tsx
@@@ -40,8 -43,12 +40,8 @@@ import
setUserTablePreference
} from "@app/helpers/userTablePreferences";
import { useDebounce, usePagination, usePopUp, useResetPageHelper } from "@app/hooks";
-import {
- useOrgAdminAccessProject,
- useRequestProjectAccess,
- useSearchProjects
-} from "@app/hooks/api";
+import { useOrgAdminAccessProject, useSearchProjects } from "@app/hooks/api";
- import { ProjectType, Workspace, WorkspaceEnv } from "@app/hooks/api/workspace/types";
+ import { Project, ProjectEnv, ProjectType } from "@app/hooks/api/projects/types";
import {
ProjectListToggle,
ProjectListView
diff --cc frontend/src/pages/project/AppConnectionsPage/AppConnectionsPage.tsx
index 36a8ffeb0f,0000000000..84fb69b832
mode 100644,000000..100644
--- a/frontend/src/pages/project/AppConnectionsPage/AppConnectionsPage.tsx
+++ b/frontend/src/pages/project/AppConnectionsPage/AppConnectionsPage.tsx
@@@ -1,44 -1,0 +1,41 @@@
+import { Helmet } from "react-helmet";
+
+import { PageHeader } from "@app/components/v2";
- import { useWorkspace } from "@app/context";
++import { useProject } from "@app/context";
+import {
+ ProjectPermissionAppConnectionActions,
+ ProjectPermissionSub
+} from "@app/context/ProjectPermissionContext/types";
+import { withProjectPermission } from "@app/hoc";
+import { AppConnectionsTable } from "@app/pages/organization/AppConnections/AppConnectionsPage/components";
+
+export const AppConnectionsPage = withProjectPermission(
+ () => {
- const { currentWorkspace } = useWorkspace();
++ const { currentProject } = useProject();
+
+ return (
+ <div className="bg-bunker-800">
+ <Helmet>
+ <title>Infisical | App Connections</title>
+ <link rel="icon" href="/infisical.ico" />
+ <meta property="og:image" content="/images/message.png" />
+ </Helmet>
+ <div className="flex w-full justify-center bg-bunker-800 text-white">
+ <div className="w-full max-w-7xl">
+ <PageHeader
+ className="w-full"
+ title="App Connections"
+ description="Manage project App Connections"
+ />
+
- <AppConnectionsTable
- projectId={currentWorkspace.id}
- projectType={currentWorkspace.type}
- />
++ <AppConnectionsTable projectId={currentProject.id} projectType={currentProject.type} />
+ </div>
+ </div>
+ </div>
+ );
+ },
+ {
+ action: ProjectPermissionAppConnectionActions.Read,
+ subject: ProjectPermissionSub.AppConnections
+ }
+);
diff --cc frontend/src/pages/project/RoleDetailsBySlugPage/components/RolePermissionsSection.tsx
index f11756dc9f,4dcd4ee1b1..347ebaf99c
--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/RolePermissionsSection.tsx
+++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/RolePermissionsSection.tsx
@@@ -12,11 -12,10 +12,11 @@@ import { ProjectPermissionSub, useProje
import { ProjectPermissionSet } from "@app/context/ProjectPermissionContext";
import { evaluatePermissionsAbility } from "@app/helpers/permissions";
import { useGetProjectRoleBySlug, useUpdateProjectRole } from "@app/hooks/api";
+ import { ProjectType } from "@app/hooks/api/projects/types";
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
- import { ProjectType } from "@app/hooks/api/workspace/types";
import { AddPoliciesButton } from "./AddPoliciesButton";
+import { AppConnectionPermissionConditions } from "./AppConnectionPermissionConditions";
import { DynamicSecretPermissionConditions } from "./DynamicSecretPermissionConditions";
import { GeneralPermissionConditions } from "./GeneralPermissionConditions";
import { GeneralPermissionPolicies } from "./GeneralPermissionPolicies";
diff --cc frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncsTab.tsx
index 036fcf03f9,04a1cd7708..f1866cda00
--- a/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncsTab.tsx
+++ b/frontend/src/pages/secret-manager/IntegrationsListPage/components/SecretSyncsTab/SecretSyncsTab.tsx
@@@ -5,10 -5,9 +5,10 @@@ import { useNavigate, useSearch } from
import { ProjectPermissionCan } from "@app/components/permissions";
import { CreateSecretSyncModal } from "@app/components/secret-syncs";
+import { TSecretSyncForm } from "@app/components/secret-syncs/forms/schemas";
import { Button, Spinner } from "@app/components/v2";
import { ROUTE_PATHS } from "@app/const/routes";
- import { ProjectPermissionSub, useWorkspace } from "@app/context";
+ import { ProjectPermissionSub, useProject } from "@app/context";
import { ProjectPermissionSecretSyncActions } from "@app/context/ProjectPermissionContext/types";
import { usePopUp } from "@app/hooks";
import { useListSecretSyncs } from "@app/hooks/api/secretSyncs";
@@@ -40,40 -38,8 +40,40 @@@ export const SecretSyncsTab = () =>
});
}, [addSync]);
+ useEffect(() => {
+ if (connectionId && connectionName) {
+ const storedFormData = localStorage.getItem("secretSyncFormData");
+
+ if (!storedFormData) return;
+
+ let form: Partial<TSecretSyncForm> = {};
+ try {
+ form = JSON.parse(storedFormData) as TSecretSyncForm;
+ } catch {
+ return;
+ } finally {
+ localStorage.removeItem("secretSyncFormData");
+ }
+
+ handlePopUpOpen("addSync", form.destination);
+
+ setInitialSyncFormData({
+ ...form,
+ connection: { id: connectionId, name: connectionName }
+ });
+
+ navigate({
+ to: ROUTE_PATHS.SecretManager.IntegrationsListPage.path,
+ params: {
- projectId: currentWorkspace.id
++ projectId: currentProject.id
+ },
+ search
+ });
+ }
+ }, [connectionId, connectionName]);
+
const { data: secretSyncs = [], isPending: isSecretSyncsPending } = useListSecretSyncs(
- currentWorkspace.id,
+ currentProject.id,
{
refetchInterval: 30000
}