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
misc: fixed log clipping and added idempotency to session end
Sheen Capadngan5f4735926cba
diff --git a/backend/src/ee/services/pam-session/pam-session-service.ts b/backend/src/ee/services/pam-session/pam-session-service.tsindex 0b37422e5a..07185bec2a 100644--- a/backend/src/ee/services/pam-session/pam-session-service.ts+++ b/backend/src/ee/services/pam-session/pam-session-service.ts@@ -152,6 +152,13 @@ export const pamSessionServiceFactory = ({OrgPermissionSubjects.Gateway);+ if (session.status === PamSessionStatus.Ended) {+ return {+ session,+ projectId: project.id+ };+ }+if (session.status !== PamSessionStatus.Active) {throw new BadRequestError({ message: "Cannot end sessions that are not active" });}diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamAccessAccountModal.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamAccessAccountModal.tsxindex 8ef588e23a..be3d40001a 100644--- a/frontend/src/pages/pam/PamAccountsPage/components/PamAccessAccountModal.tsx+++ b/frontend/src/pages/pam/PamAccountsPage/components/PamAccessAccountModal.tsx@@ -5,7 +5,7 @@ import ms from "ms";import { createNotification } from "@app/components/notifications";import { Button, FormLabel, Input, Modal, ModalClose, ModalContent } from "@app/components/v2";-import { TPamAccount } from "@app/hooks/api/pam";+import { PamResourceType, TPamAccount } from "@app/hooks/api/pam";type Props = {account?: TPamAccount;@@ -19,7 +19,10 @@ export const PamAccessAccountModal = ({ isOpen, onOpenChange, account }: Props)const isDurationValid = useMemo(() => duration && ms(duration || "1s") > 0, [duration]);const command = useMemo(- () => (account ? `infisical pam access ${account.id} --duration ${duration}` : ""),+ () =>+ account && account.resource.resourceType === PamResourceType.Postgres+ ? `infisical pam db access-account ${account.id} --duration ${duration}`+ : "",[account, duration]);diff --git a/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogsSection.tsx b/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogsSection.tsxindex 81a2471dd8..c07e0d1abd 100644--- a/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogsSection.tsx+++ b/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogsSection.tsx@@ -13,7 +13,7 @@ export const PamSessionLogsSection = ({ session }: Props) => {<div className="flex items-center border-b border-mineshaft-400 pb-4"><h3 className="text-lg font-semibold text-mineshaft-100">Session Logs</h3></div>- <div className="flex grow flex-col gap-4 text-xs">+ <div className="flex grow flex-col gap-4 overflow-y-auto text-xs">{session.commandLogs.length > 0 ? (session.commandLogs.map((log) => (<div key={log.timestamp} className="flex flex-col">@@ -22,8 +22,12 @@ export const PamSessionLogsSection = ({ session }: Props) => {<span>{new Date(log.timestamp).toLocaleString()}</span></div>- <div className="whitespace-pre-wrap font-mono">{log.input}</div>- <div className="whitespace-pre-wrap font-mono text-bunker-300">{log.output}</div>+ <div className="overflow-hidden whitespace-pre-wrap break-all font-mono">+ {log.input}+ </div>+ <div className="overflow-hidden whitespace-pre-wrap break-all font-mono text-bunker-300">+ {log.output}+ </div></div>))) : (