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
address comments
adilson0795522f2423
diff --git a/backend/src/services/integration/integration-deprecation-fns.ts b/backend/src/services/integration/integration-deprecation-fns.tsindex 1437c504fc..6b3caed3ec 100644--- a/backend/src/services/integration/integration-deprecation-fns.ts+++ b/backend/src/services/integration/integration-deprecation-fns.ts@@ -35,10 +35,19 @@ export const groupIntegrationsByProject = (}));/**- * Deep link to a project's native integrations tab — same URL the integration sync failure email builds.+ * Deep link to a project's native integrations tab, relative to the site root. In-app notification links must stay+ * relative — the frontend router resolves them against the current location, so an absolute URL would be appended+ * to the path the user is already on.+ */+export const buildNativeIntegrationsPath = (orgId: string, projectId: string) =>+ `/organizations/${orgId}/projects/secret-management/${projectId}/integrations?selectedTab=native-integrations`;++/**+ * Absolute variant of {@link buildNativeIntegrationsPath} for emails — same URL the integration sync failure email+ * builds.*/export const buildNativeIntegrationsUrl = (siteUrl: string, orgId: string, projectId: string) =>- `${siteUrl}/organizations/${orgId}/projects/secret-management/${projectId}/integrations?selectedTab=native-integrations`;+ `${siteUrl}${buildNativeIntegrationsPath(orgId, projectId)}`;/*** Turns membership rows into mailable recipients: drops members with no email, anyone already reached by anotherdiff --git a/backend/src/services/integration/integration-deprecation-queue.ts b/backend/src/services/integration/integration-deprecation-queue.tsindex 5f4b820302..c876acaafc 100644--- a/backend/src/services/integration/integration-deprecation-queue.ts+++ b/backend/src/services/integration/integration-deprecation-queue.ts@@ -14,6 +14,7 @@ import { SmtpTemplates, TSmtpService } from "@app/services/smtp/smtp-service";import { TIntegrationDALFactory } from "./integration-dal";import {+ buildNativeIntegrationsPath,buildNativeIntegrationsUrl,groupIntegrationsByProject,TIntegrationProjectSummary,@@ -70,6 +71,7 @@ export const integrationDeprecationQueueFactory = ({projects: TIntegrationProjectSummary[];recipients: TNoticeRecipient[];siteUrl: string;+ /** site-relative — see buildNativeIntegrationsPath */link?: string;}) => {if (!recipients.length || !projects.length) return;@@ -151,7 +153,7 @@ export const integrationDeprecationQueueFactory = ({const orgAdminRecipients = toRecipients(orgAdmins- .filter((admin) => admin.status !== OrgMembershipStatus.Invited)+ .filter((admin) => admin.status !== OrgMembershipStatus.Invited && !admin.isTemporary).map((admin) => ({ userId: admin.user.id, email: admin.user.email })));const orgAdminUserIds = new Set(orgAdminRecipients.map((recipient) => recipient.userId));@@ -168,7 +170,7 @@ export const integrationDeprecationQueueFactory = ({await notify(orgAdminRecipients,projects,- projects.length === 1 ? buildNativeIntegrationsUrl(siteUrl, orgId, projects[0].projectId) : undefined+ projects.length === 1 ? buildNativeIntegrationsPath(orgId, projects[0].projectId) : undefined);// then each project's admins get a notice scoped to their own project, minus anyone already reached above@@ -176,7 +178,7 @@ export const integrationDeprecationQueueFactory = ({await notify(toRecipients(projectAdminsByProjectId[project.projectId] ?? [], orgAdminUserIds),[project],- buildNativeIntegrationsUrl(siteUrl, orgId, project.projectId)+ buildNativeIntegrationsPath(orgId, project.projectId));}diff --git a/backend/src/services/org/org-dal.ts b/backend/src/services/org/org-dal.tsindex 1dac1fbfba..aee1b3c800 100644--- a/backend/src/services/org/org-dal.ts+++ b/backend/src/services/org/org-dal.ts@@ -608,6 +608,7 @@ export const orgDALFactory = (db: TDbClient) => {conn.ref("scopeOrgId").withSchema(TableName.Membership).as("orgId"),conn.ref("role").withSchema(TableName.MembershipRole),conn.ref("customRoleId").withSchema(TableName.MembershipRole).as("roleId"),+ conn.ref("isTemporary").withSchema(TableName.MembershipRole),conn.ref("status").withSchema(TableName.Membership),conn.ref("username").withSchema(TableName.Users),conn.ref("email").withSchema(TableName.Users),diff --git a/frontend/src/layouts/OrganizationLayout/components/NativeIntegrationsBanner/NativeIntegrationsBanner.tsx b/frontend/src/layouts/OrganizationLayout/components/NativeIntegrationsBanner/NativeIntegrationsBanner.tsxindex 1e9a67d813..d3998821a2 100644--- a/frontend/src/layouts/OrganizationLayout/components/NativeIntegrationsBanner/NativeIntegrationsBanner.tsx+++ b/frontend/src/layouts/OrganizationLayout/components/NativeIntegrationsBanner/NativeIntegrationsBanner.tsx@@ -1,7 +1,7 @@import { faArrowUpRightFromSquare, faWarning, faXmark } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { IconButton } from "@app/components/v2";+import { IconButton } from "@app/components/v3";import { useOrganization, useOrgPermission } from "@app/context";import { OrgMembershipRole } from "@app/helpers/roles";import { useBannerDismissal } from "@app/hooks";@@ -12,7 +12,7 @@ const SECRET_SYNCS_DOCS_URL = "https://infisical.com/docs/integrations/secret-syexport const NativeIntegrationsBanner = () => {const { currentOrg } = useOrganization();- const [isDismissed, dismiss] = useBannerDismissal(DISMISS_STORAGE_KEY);+ const [isDismissed, dismiss] = useBannerDismissal(`${DISMISS_STORAGE_KEY}-${currentOrg.id}`);const { hasOrgRole } = useOrgPermission();const isOrgAdmin = hasOrgRole(OrgMembershipRole.Admin);@@ -43,9 +43,10 @@ export const NativeIntegrationsBanner = () => {/></a><IconButton- className="ml-auto shrink-0 p-0 text-yellow-200"- ariaLabel="Dismiss banner"- variant="plain"+ className="ml-auto shrink-0 text-yellow-200"+ aria-label="Dismiss banner"+ variant="ghost"+ size="xs"onClick={dismiss}><FontAwesomeIcon icon={faXmark} />diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/NotificationDropdown.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/NotificationDropdown.tsxindex 77c1fe1794..959ad082ba 100644--- a/frontend/src/layouts/OrganizationLayout/components/NavBar/NotificationDropdown.tsx+++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/NotificationDropdown.tsx@@ -17,7 +17,7 @@ import {useUpdateNotification} from "@app/hooks/api/notifications/mutations";import { useGetMyNotifications } from "@app/hooks/api/notifications/queries";-import { isCriticalNotification } from "@app/hooks/api/notifications/types";+import { isCriticalNotification, TUserNotification } from "@app/hooks/api/notifications/types";import { Notification } from "./Notification";@@ -29,6 +29,27 @@ export const NotificationDropdown = () => {const { mutate: updateNotification } = useUpdateNotification();const { mutate: deleteNotification } = useDeleteNotification();+ // Links are stored server-side and may be site-relative or absolute, and may carry a query string. Passing them+ // straight to `to` would resolve them against the current path and swallow the search params, so normalize to a+ // path + search + hash and let the router parse it via `href`.+ const openNotificationLink = (link: string) => {+ try {+ const { pathname, search, hash } = new URL(link, window.location.origin);+ router.navigate({ href: `${pathname}${search}${hash}` });+ } catch {+ router.navigate({ to: link });+ }+ };++ const handleNotificationOpen = (notification: TUserNotification) => {+ if (!notification.isRead) {+ updateNotification({ notificationId: notification.id, isRead: true });+ }+ if (notification.link) {+ openNotificationLink(notification.link);+ }+ };+const unreadCount = useMemo(() => notifications?.filter((n) => !n.isRead).length || 0,[notifications]@@ -103,22 +124,10 @@ export const NotificationDropdown = () => {role="button"tabIndex={0}key={notification.id}- onClick={() => {- if (!notification.isRead) {- updateNotification({ notificationId: notification.id, isRead: true });- }- if (notification.link) {- router.navigate({ to: notification.link });- }- }}+ onClick={() => handleNotificationOpen(notification)}onKeyDown={(e) => {if (e.key !== "Enter") return;- if (!notification.isRead) {- updateNotification({ notificationId: notification.id, isRead: true });- }- if (notification.link) {- router.navigate({ to: notification.link });- }+ handleNotificationOpen(notification);}}><Notification notification={notification} onDelete={deleteNotification} />