Skip to content

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

Merge remote-tracking branch 'origin/main' into feat/cardDeclinedAlert

Carlos Monastyrskieb60bbfd1a6c
diff --cc frontend/src/hooks/api/subscriptions/types.ts
index 6042df67de,338599fe04..0c3733cc80
--- a/frontend/src/hooks/api/subscriptions/types.ts
+++ b/frontend/src/hooks/api/subscriptions/types.ts
@@@ -53,6 -54,5 +54,7 @@@ export type SubscriptionPlan =
secretScanning: boolean;
enterpriseSecretSyncs: boolean;
enterpriseAppConnections: boolean;
+ cardDeclined?: boolean;
+ cardDeclinedReason?: string;
+ machineIdentityAuthTemplates: boolean;
};
diff --cc frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx
index 96da887b1f,63da8b5338..e9bb6a902a
--- a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx
@@@ -8,9 -8,9 +8,10 @@@ import
faCaretDown,
faCheck,
faEnvelope,
+ faExclamationTriangle,
faInfo,
faInfoCircle,
+ faServer,
faSignOut,
faUser,
faUsers
@@@ -196,104 -192,117 +201,130 @@@ export const Navbar = () =>
</Link>
</div>
<p className="pl-1 pr-3 text-lg text-mineshaft-400/70">/</p>
- <div className="flex items-center">
- <DropdownMenu modal={false}>
- <Link to="/organization/projects">
- <div className="group flex cursor-pointer items-center gap-2 text-sm text-white transition-all duration-100 hover:text-primary">
- <div>
- <FontAwesomeIcon icon={faBuilding} className="text-xs text-bunker-300" />
- </div>
- <div className="whitespace-nowrap">{currentOrg?.name}</div>
- <div className="flex items-center gap-1">
- <div className="mr-1 rounded border border-mineshaft-500 px-1 text-xs text-bunker-300 !no-underline">
- {getPlan(subscription)}
- </div>
- {subscription.cardDeclined && (
- <Tooltip
- content={`Your payment could not be processed${subscription.cardDeclinedReason ? `: ${subscription.cardDeclinedReason}` : ""}. Please update your payment method to continue enjoying premium features.`}
- className="max-w-xs"
- >
- <div className="flex items-center">
- <FontAwesomeIcon
- icon={faExclamationTriangle}
- className="animate-pulse cursor-help text-xs text-primary-400"
- />
- </div>
- </Tooltip>
- )}
- </div>
+ {isServerAdminPanel ? (
+ <>
+ <Link
+ to="/admin"
+ className="group flex cursor-pointer items-center gap-2 text-sm text-white transition-all duration-100 hover:text-primary"
+ >
+ <div>
+ <FontAwesomeIcon icon={faServer} className="text-xs text-bunker-300" />
</div>
+ <div className="whitespace-nowrap">Server Console</div>
</Link>
- <DropdownMenuTrigger asChild>
- <div>
- <IconButton
- variant="plain"
- colorSchema="secondary"
- ariaLabel="switch-org"
- className="px-2 py-1"
+ <p className="pl-3 pr-3 text-lg text-mineshaft-400/70">/</p>
+ {breadcrumbs ? (
+ // scott: remove /admin as we show server console above
+ <BreadcrumbContainer breadcrumbs={breadcrumbs.slice(1) as TBreadcrumbFormat[]} />
+ ) : null}
+ </>
+ ) : (
+ <>
+ <div className="flex items-center">
+ <DropdownMenu modal={false}>
+ <Link to="/organization/projects">
+ <div className="group flex cursor-pointer items-center gap-2 text-sm text-white transition-all duration-100 hover:text-primary">
+ <div>
+ <FontAwesomeIcon icon={faBuilding} className="text-xs text-bunker-300" />
+ </div>
+ <div className="whitespace-nowrap">{currentOrg?.name}</div>
+ <div className="mr-1 rounded border border-mineshaft-500 px-1 text-xs text-bunker-300 !no-underline">
+ {getPlan(subscription)}
+ </div>
++ {subscription.cardDeclined && (
++ <Tooltip
++ content={`Your payment could not be processed${subscription.cardDeclinedReason ? `: ${subscription.cardDeclinedReason}` : ""}. Please update your payment method to continue enjoying premium features.`}
++ className="max-w-xs"
++ >
++ <div className="flex items-center">
++ <FontAwesomeIcon
++ icon={faExclamationTriangle}
++ className="animate-pulse cursor-help text-xs text-primary-400"
++ />
++ </div>
++ </Tooltip>
++ )}
+ </div>
+ </Link>
+ <DropdownMenuTrigger asChild>
+ <div>
+ <IconButton
+ variant="plain"
+ colorSchema="secondary"
+ ariaLabel="switch-org"
+ className="px-2 py-1"
+ >
+ <FontAwesomeIcon icon={faCaretDown} className="text-xs text-bunker-300" />
+ </IconButton>
+ </div>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent
+ align="start"
+ side="bottom"
+ className="mt-6 cursor-default p-1 shadow-mineshaft-600 drop-shadow-md"
+ style={{ minWidth: "220px" }}
>
- <FontAwesomeIcon icon={faCaretDown} className="text-xs text-bunker-300" />
- </IconButton>
- </div>
- </DropdownMenuTrigger>
- <DropdownMenuContent
- align="start"
- side="bottom"
- className="mt-6 cursor-default p-1 shadow-mineshaft-600 drop-shadow-md"
- style={{ minWidth: "220px" }}
- >
- <div className="px-2 py-1 text-xs capitalize text-mineshaft-400">organizations</div>
- {orgs?.map((org) => {
- return (
- <DropdownMenuItem key={org.id}>
- <Button
- onClick={async () => {
- if (currentOrg?.id === org.id) return;
+ <div className="px-2 py-1 text-xs capitalize text-mineshaft-400">organizations</div>
+ {orgs?.map((org) => {
+ return (
+ <DropdownMenuItem key={org.id}>
+ <Button
+ onClick={async () => {
+ if (currentOrg?.id === org.id) return;
- if (org.authEnforced) {
- // org has an org-level auth method enabled (e.g. SAML)
- // -> logout + redirect to SAML SSO
+ if (org.authEnforced) {
+ // org has an org-level auth method enabled (e.g. SAML)
+ // -> logout + redirect to SAML SSO
- await logout.mutateAsync();
- if (org.orgAuthMethod === AuthMethod.OIDC) {
- window.open(`/api/v1/sso/oidc/login?orgSlug=${org.slug}`);
- } else {
- window.open(`/api/v1/sso/redirect/saml2/organizations/${org.slug}`);
- }
- window.close();
- return;
- }
+ await logout.mutateAsync();
+ if (org.orgAuthMethod === AuthMethod.OIDC) {
+ window.open(`/api/v1/sso/oidc/login?orgSlug=${org.slug}`);
+ } else {
+ window.open(`/api/v1/sso/redirect/saml2/organizations/${org.slug}`);
+ }
+ window.close();
+ return;
+ }
- handleOrgChange(org?.id);
- }}
- variant="plain"
- colorSchema="secondary"
- size="xs"
- className="flex w-full items-center justify-start p-0 font-normal"
- leftIcon={
- currentOrg?.id === org.id && (
- <FontAwesomeIcon icon={faCheck} className="mr-3 text-primary" />
- )
- }
- >
- <div className="flex w-full max-w-[150px] items-center justify-between truncate">
- {org.name}
- </div>
- </Button>
+ if (org.googleSsoAuthEnforced) {
+ await logout.mutateAsync();
+ window.open(`/api/v1/sso/redirect/google?org_slug=${org.slug}`);
+ window.close();
+ return;
+ }
+
+ handleOrgChange(org?.id);
+ }}
+ variant="plain"
+ colorSchema="secondary"
+ size="xs"
+ className="flex w-full items-center justify-start p-0 font-normal"
+ leftIcon={
+ currentOrg?.id === org.id && (
+ <FontAwesomeIcon icon={faCheck} className="mr-3 text-primary" />
+ )
+ }
+ >
+ <div className="flex w-full max-w-[150px] items-center justify-between truncate">
+ {org.name}
+ </div>
+ </Button>
+ </DropdownMenuItem>
+ );
+ })}
+ <div className="mt-1 h-1 border-t border-mineshaft-600" />
+ <DropdownMenuItem icon={<FontAwesomeIcon icon={faSignOut} />} onClick={logOutUser}>
+ Log Out
</DropdownMenuItem>
- );
- })}
- <div className="mt-1 h-1 border-t border-mineshaft-600" />
- <DropdownMenuItem icon={<FontAwesomeIcon icon={faSignOut} />} onClick={logOutUser}>
- Log Out
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- </div>
- <p className="pl-1 pr-3 text-lg text-mineshaft-400/70">/</p>
- {breadcrumbs ? (
- <BreadcrumbContainer breadcrumbs={breadcrumbs as TBreadcrumbFormat[]} />
- ) : null}
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </div>
+ <p className="pl-1 pr-3 text-lg text-mineshaft-400/70">/</p>
+ {breadcrumbs ? (
+ <BreadcrumbContainer breadcrumbs={breadcrumbs as TBreadcrumbFormat[]} />
+ ) : null}
+ </>
+ )}
<div className="flex-grow" />
<DropdownMenu modal={false}>
<DropdownMenuTrigger>