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
Requested changes
Daniel Hougaard449e7672f9f8
diff --git a/backend/src/ee/services/audit-log/audit-log-dal.ts b/backend/src/ee/services/audit-log/audit-log-dal.tsindex 18eb1a8cbe..5e5e6872ba 100644--- a/backend/src/ee/services/audit-log/audit-log-dal.ts+++ b/backend/src/ee/services/audit-log/audit-log-dal.ts@@ -48,6 +48,10 @@ export const auditLogDALFactory = (db: TDbClient) => {},tx?: Knex) => {+ if (!orgId && !projectId) {+ throw new Error("Either orgId or projectId must be provided");+ }+try {// Find statementsconst sqlQuery = (tx || db.replicaNode())(TableName.AuditLog)@@ -59,11 +63,12 @@ export const auditLogDALFactory = (db: TDbClient) => {} else if (projectId) {void this.where(`${TableName.AuditLog}.projectId`, projectId);}- if (userAgentType) {- void this.where(`${TableName.AuditLog}.userAgentType`, userAgentType);- }});+ if (userAgentType) {+ void sqlQuery.where("userAgentType", userAgentType);+ }+// Select statementsvoid sqlQuery.select(selectAllTableCols(TableName.AuditLog))diff --git a/frontend/src/views/Org/AuditLogsPage/components/LogsFilter.tsx b/frontend/src/views/Org/AuditLogsPage/components/LogsFilter.tsxindex cf00c9b0a8..9ea92f9a92 100644--- a/frontend/src/views/Org/AuditLogsPage/components/LogsFilter.tsx+++ b/frontend/src/views/Org/AuditLogsPage/components/LogsFilter.tsx@@ -231,7 +231,7 @@ export const LogsFilter = ({)}/>- {isOrgAuditLogs && workspaces.length && (+ {isOrgAuditLogs && workspaces.length > 0 && (<Controllercontrol={control}name="projectId"diff --git a/frontend/src/views/Org/AuditLogsPage/components/LogsTable.tsx b/frontend/src/views/Org/AuditLogsPage/components/LogsTable.tsxindex e8f1231436..2922754aee 100644--- a/frontend/src/views/Org/AuditLogsPage/components/LogsTable.tsx+++ b/frontend/src/views/Org/AuditLogsPage/components/LogsTable.tsx@@ -41,8 +41,16 @@ export const LogsTable = ({}: Props) => {const { currentWorkspace } = useWorkspace();+ // Determine the project ID for filteringconst filterProjectId =- filter?.projectId ?? (!isOrgAuditLogs ? currentWorkspace?.id ?? "" : null);+ // Use the projectId from the filter if it exists+ filter?.projectId ??+ // Otherwise, if we're not looking at org-wide audit logs+ (!isOrgAuditLogs+ ? // Use the current workspace ID (or an empty string if that's null)+ currentWorkspace?.id ?? ""+ : // For org-wide audit logs, use null (no specific project filter)+ null);const { data, isLoading, isFetchingNextPage, hasNextPage, fetchNextPage } = useGetAuditLogs({