misc: fixed log clipping and added idempotency to session end

This commit is contained in:
Sheen Capadngan
2025-10-03 21:51:22 +08:00
parent 6a7d84f052
commit 5f4735926c
3 changed files with 19 additions and 5 deletions
@@ -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]
);