import { faPlug, faPlus } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal"; import { createNotification } from "@app/components/notifications"; import { OrgPermissionCan } from "@app/components/permissions"; import { Button, DeleteActionModal, EmptyState, Modal, ModalContent, Table, TableContainer, TableSkeleton, TBody, Td, THead, Tr } from "@app/components/v2"; import { OrgPermissionActions, OrgPermissionSubjects, useOrganization, useSubscription } from "@app/context"; import { withPermission } from "@app/hoc"; import { usePopUp } from "@app/hooks"; import { useDeleteAuditLogStream, useGetAuditLogStreams } from "@app/hooks/api"; import { AuditLogStreamForm } from "./AuditLogStreamForm"; export const AuditLogStreamsTab = withPermission( () => { const { currentOrg } = useOrganization(); const orgId = currentOrg?.id || ""; const { popUp, handlePopUpOpen, handlePopUpToggle, handlePopUpClose } = usePopUp([ "auditLogStreamForm", "deleteAuditLogStream", "upgradePlan" ] as const); const { subscription } = useSubscription(); const { data: auditLogStreams, isPending: isAuditLogStreamsLoading } = useGetAuditLogStreams(orgId); // mutation const { mutateAsync: deleteAuditLogStream } = useDeleteAuditLogStream(); const handleAuditLogStreamDelete = async () => { try { const auditLogStreamId = popUp?.deleteAuditLogStream?.data as string; await deleteAuditLogStream({ id: auditLogStreamId, orgId }); handlePopUpClose("deleteAuditLogStream"); createNotification({ type: "success", text: "Successfully deleted stream" }); } catch (err) { console.log(err); createNotification({ type: "error", text: "Failed to delete stream" }); } }; return (

Audit Log Streams

{(isAllowed) => ( )}

Send audit logs from Infisical to external logging providers via HTTP

{isAuditLogStreamsLoading && ( )} {!isAuditLogStreamsLoading && auditLogStreams && auditLogStreams?.length === 0 && ( )} {!isAuditLogStreamsLoading && auditLogStreams?.map(({ id, url }) => ( ))}
URL Action
{url}
{(isAllowed) => ( )} {(isAllowed) => ( )}
{ handlePopUpToggle("auditLogStreamForm", isModalOpen); }} > handlePopUpToggle("auditLogStreamForm")} /> handlePopUpToggle("upgradePlan", isOpen)} text="You can add audit log streams if you switch to Infisical's Enterprise plan." /> handlePopUpToggle("deleteAuditLogStream", isOpen)} onClose={() => handlePopUpClose("deleteAuditLogStream")} onDeleteApproved={handleAuditLogStreamDelete} />
); }, { action: OrgPermissionActions.Read, subject: OrgPermissionSubjects.Settings } );