Skip to content

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

feat: return whether the clickhouse config is enabled so the FE does not call the BE

Adilson franke neia juniored543a4066a5
diff --git a/backend/src/ee/routes/v1/insights-router.ts b/backend/src/ee/routes/v1/insights-router.ts
index 78be5c2b24..3bd272583f 100644
--- a/backend/src/ee/routes/v1/insights-router.ts
+++ b/backend/src/ee/routes/v1/insights-router.ts
@@ -204,18 +204,6 @@ export const registerInsightsRouter = async (server: FastifyZodProvider) => {
orgId: req.permission.orgId
});
- await server.services.auditLog.createAuditLog({
- ...req.auditLogInfo,
- orgId: req.permission.orgId,
- event: {
- type: EventType.VIEW_INSIGHTS_SECRETS_MANAGEMENT_ORG_ACCESS_VOLUME,
- metadata: {
- isSupported: accessVolume.isSupported,
- totalEvents: accessVolume.days.reduce((sum, day) => sum + day.total, 0)
- }
- }
- });
-
return { accessVolume };
}
});
@@ -253,7 +241,6 @@ export const registerInsightsRouter = async (server: FastifyZodProvider) => {
event: {
type: EventType.VIEW_INSIGHTS_SECRETS_MANAGEMENT_ORG_AUTH_METHOD_DISTRIBUTION,
metadata: {
- isSupported: authMethodDistribution.isSupported,
totalFetches: authMethodDistribution.totalFetches
}
}
@@ -290,17 +277,6 @@ export const registerInsightsRouter = async (server: FastifyZodProvider) => {
orgId: req.permission.orgId
});
- await server.services.auditLog.createAuditLog({
- ...req.auditLogInfo,
- orgId: req.permission.orgId,
- event: {
- type: EventType.VIEW_INSIGHTS_SECRETS_MANAGEMENT_STATIC_SECRET_USAGE,
- metadata: {
- totalSecretsCreated: staticSecretUsage.weeks.reduce((sum, week) => sum + week.totalSecrets, 0)
- }
- }
- });
-
return { staticSecretUsage };
}
});
diff --git a/backend/src/ee/services/audit-log/audit-log-clickhouse-dal.ts b/backend/src/ee/services/audit-log/audit-log-clickhouse-dal.ts
index 3b577f02d6..73466c9ce9 100644
--- a/backend/src/ee/services/audit-log/audit-log-clickhouse-dal.ts
+++ b/backend/src/ee/services/audit-log/audit-log-clickhouse-dal.ts
@@ -2,7 +2,7 @@ import { type ClickHouseClient } from "@clickhouse/client";
import RE2 from "re2";
import { TDbClient } from "@app/db";
-import { TableName, TAuditLogs } from "@app/db/schemas";
+import { IdentityAuthMethod, TableName, TAuditLogs } from "@app/db/schemas";
import { DatabaseError } from "@app/lib/errors";
import { logger } from "@app/lib/logger";
import { ActorType } from "@app/services/auth/auth-type";
@@ -46,7 +46,7 @@ type TClickHouseDateVolumeRow = {
type TClickHouseDateVolumeRawRow = Omit<TClickHouseDateVolumeRow, "count"> & { count: string };
type TClickHouseAuthMethodRow = {
- authMethod: string;
+ authMethod: IdentityAuthMethod;
count: number;
};
@@ -312,6 +312,7 @@ export const clickhouseAuditLogDALFactory = (clickhouseClient: ClickHouseClient,
AND eventType IN ({eventTypes:Array(String)})
AND actor = {actorType:String}
GROUP BY authMethod
+ HAVING authMethod IN ({authMethods:Array(String)})
`;
try {
@@ -323,7 +324,8 @@ export const clickhouseAuditLogDALFactory = (clickhouseClient: ClickHouseClient,
startDate: startDate.replace("Z", ""),
endDate: endDate.replace("Z", ""),
eventTypes,
- actorType: ActorType.IDENTITY
+ actorType: ActorType.IDENTITY,
+ authMethods: Object.values(IdentityAuthMethod)
},
clickhouse_settings: {
max_execution_time: 10
diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.ts
index e84874fabd..b5b5770fc8 100644
--- a/backend/src/ee/services/audit-log/audit-log-types.ts
+++ b/backend/src/ee/services/audit-log/audit-log-types.ts
@@ -5496,8 +5496,6 @@ interface ViewSecretManagementInsightsAccessVolumeEvent {
interface ViewSecretManagementInsightsOrgAccessVolumeEvent {
type: EventType.VIEW_INSIGHTS_SECRETS_MANAGEMENT_ORG_ACCESS_VOLUME;
metadata: {
- // false when the instance stores audit logs in Postgres, in which case no volume was calculated
- isSupported: boolean;
totalEvents: number;
};
}
@@ -5505,8 +5503,6 @@ interface ViewSecretManagementInsightsOrgAccessVolumeEvent {
interface ViewSecretManagementInsightsOrgAuthMethodDistributionEvent {
type: EventType.VIEW_INSIGHTS_SECRETS_MANAGEMENT_ORG_AUTH_METHOD_DISTRIBUTION;
metadata: {
- // false when the instance stores audit logs in Postgres, in which case no distribution was calculated
- isSupported: boolean;
totalFetches: number;
};
}
diff --git a/backend/src/ee/services/audit-report/audit-report-org-generators.ts b/backend/src/ee/services/audit-report/audit-report-org-generators.ts
index d43e8d21b4..c6d7ef8099 100644
--- a/backend/src/ee/services/audit-report/audit-report-org-generators.ts
+++ b/backend/src/ee/services/audit-report/audit-report-org-generators.ts
@@ -1,6 +1,6 @@
import { z } from "zod";
-import { IdentityAuthMethod, TableName } from "@app/db/schemas";
+import { TableName } from "@app/db/schemas";
import { TClickHouseAuditLogDALFactory } from "@app/ee/services/audit-log/audit-log-clickhouse-dal";
import { TDynamicSecretLeaseDALFactory } from "@app/ee/services/dynamic-secret-lease/dynamic-secret-lease-dal";
import { TInsightsDALFactory } from "@app/ee/services/insights/insights-dal";
@@ -154,28 +154,10 @@ const authMethodsReport: TOrgReportDefinition = {
endDate: endDate.toISOString()
});
- // Logs written before the auth method was captured have no authMethod, and an instance reading
- // logs written by a newer version can see a method it does not know yet — both land in "unknown".
- const knownAuthMethods = new Set<string>(Object.values(IdentityAuthMethod));
- const countsByAuthMethod = new Map<string, number>();
- let unknownCount = 0;
-
- rows.forEach((row) => {
- if (!knownAuthMethods.has(row.authMethod)) {
- unknownCount += row.count;
- return;
- }
- countsByAuthMethod.set(row.authMethod, (countsByAuthMethod.get(row.authMethod) ?? 0) + row.count);
- });
-
- const methodRows = Array.from(countsByAuthMethod.entries())
- .map(([authMethod, count]) => ({ authMethod, count }))
+ const methodRows = rows
+ .map((row) => ({ authMethod: row.authMethod, count: row.count }))
.sort((a, b) => b.count - a.count);
- if (unknownCount > 0) {
- methodRows.push({ authMethod: "unknown", count: unknownCount });
- }
-
return { columns: ["authMethod", "count"], rows: methodRows, truncated: false };
}
};
diff --git a/backend/src/ee/services/insights/insights-schemas.ts b/backend/src/ee/services/insights/insights-schemas.ts
index cd96de46dc..199bbeb157 100644
--- a/backend/src/ee/services/insights/insights-schemas.ts
+++ b/backend/src/ee/services/insights/insights-schemas.ts
@@ -27,7 +27,6 @@ export const SecretsProjectWarningSchema = z.object({
});
export const OrgSecretsAccessVolumeSchema = z.object({
- isSupported: z.boolean().describe(INSIGHTS.GET_SECRETS_ACCESS_VOLUME.isSupported),
days: z
.object({
date: z.string().describe(INSIGHTS.GET_SECRETS_ACCESS_VOLUME.date),
@@ -38,9 +37,7 @@ export const OrgSecretsAccessVolumeSchema = z.object({
});
export const OrgAuthMethodDistributionSchema = z.object({
- isSupported: z.boolean().describe(INSIGHTS.GET_SECRETS_AUTH_METHOD_DISTRIBUTION.isSupported),
totalFetches: z.number().int().describe(INSIGHTS.GET_SECRETS_AUTH_METHOD_DISTRIBUTION.totalFetches),
- unknownCount: z.number().int().describe(INSIGHTS.GET_SECRETS_AUTH_METHOD_DISTRIBUTION.unknownCount),
methods: z
.object({
authMethod: z.nativeEnum(IdentityAuthMethod).describe(INSIGHTS.GET_SECRETS_AUTH_METHOD_DISTRIBUTION.authMethod),
diff --git a/backend/src/ee/services/insights/insights-service.ts b/backend/src/ee/services/insights/insights-service.ts
index eae08f340b..f7c74dc99e 100644
--- a/backend/src/ee/services/insights/insights-service.ts
+++ b/backend/src/ee/services/insights/insights-service.ts
@@ -70,8 +70,6 @@ export type TInsightsServiceFactoryDep = {
permissionService: Pick<TPermissionServiceFactory, "getProjectPermission" | "getOrgPermission">;
licenseService: Pick<TLicenseServiceFactory, "getPlan">;
auditLogDAL: Pick<TAuditLogDALFactory, "countByDateAndActor" | "countByAuthMethod">;
- // Undefined when the instance has no ClickHouse configured. Only the org-wide aggregates use it,
- // and each degrades to an unsupported no-op response in that case.
clickhouseAuditLogDAL?: Pick<TClickHouseAuditLogDALFactory, "countByDateForOrg" | "countByIdentityAuthMethodForOrg">;
secretRotationV2DAL: Pick<
TSecretRotationV2DALFactory,
@@ -625,7 +623,10 @@ export const insightsServiceFactory = ({
const appCfg = getConfig();
if (!appCfg.CLICKHOUSE_AUDIT_LOG_ENABLED || !clickhouseAuditLogDAL) {
- return { days: [], isSupported: false };
+ throw new BadRequestError({
+ message:
+ "Secret access volume requires audit logs to be stored in ClickHouse, which is not enabled on this instance"
+ });
}
const cacheKey = KeyStorePrefixes.InsightsCache(dto.orgId, "org-access-volume");
@@ -646,8 +647,7 @@ export const insightsServiceFactory = ({
const countsByDate = new Map(rows.map((row) => [row.date, row.count]));
return {
- days: dates.map((date) => ({ date, total: countsByDate.get(date) ?? 0 })),
- isSupported: true
+ days: dates.map((date) => ({ date, total: countsByDate.get(date) ?? 0 }))
};
}
});
@@ -658,7 +658,10 @@ export const insightsServiceFactory = ({
const appCfg = getConfig();
if (!appCfg.CLICKHOUSE_AUDIT_LOG_ENABLED || !clickhouseAuditLogDAL) {
- return { methods: [], totalFetches: 0, unknownCount: 0, isSupported: false };
+ throw new BadRequestError({
+ message:
+ "Identity authentication method usage requires audit logs to be stored in ClickHouse, which is not enabled on this instance"
+ });
}
const cacheKey = KeyStorePrefixes.InsightsCache(dto.orgId, "org-auth-method-distribution");
@@ -676,30 +679,12 @@ export const insightsServiceFactory = ({
endDate: endDate.toISOString()
});
- const knownAuthMethods = new Set<string>(Object.values(IdentityAuthMethod));
- const countsByAuthMethod = new Map<IdentityAuthMethod, number>();
- let unknownCount = 0;
- let totalFetches = 0;
-
- rows.forEach((row) => {
- totalFetches += row.count;
-
- // Logs written before the auth method was captured have no authMethod, and an instance
- // reading logs written by a newer version can see a method it does not know yet.
- if (!knownAuthMethods.has(row.authMethod)) {
- unknownCount += row.count;
- return;
- }
-
- const authMethod = row.authMethod as IdentityAuthMethod;
- countsByAuthMethod.set(authMethod, (countsByAuthMethod.get(authMethod) ?? 0) + row.count);
- });
-
- const methods = Array.from(countsByAuthMethod.entries())
- .map(([authMethod, count]) => ({ authMethod, count }))
+ const methods = rows
+ .map((row) => ({ authMethod: row.authMethod, count: row.count }))
.sort((a, b) => b.count - a.count);
+ const totalFetches = rows.reduce((sum, row) => sum + row.count, 0);
- return { methods, totalFetches, unknownCount, isSupported: true };
+ return { methods, totalFetches };
}
});
};
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index fedb6e4ae2..7e92b22669 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -920,25 +920,19 @@ export const INSIGHTS = {
projectsWithIssues: "The number of secret management projects in the organization with at least one issue."
},
GET_SECRETS_ACCESS_VOLUME: {
- isSupported:
- "Whether access volume could be calculated. This endpoint requires the instance to store audit logs in ClickHouse. When audit logs are stored in PostgreSQL this is false and no days are returned.",
days: "One entry for each of the last seven days, oldest first. Days with no secret access are included with a total of zero.",
date: "The day the accesses happened on, in UTC, as YYYY-MM-DD.",
total:
"The number of times a secret value was accessed across every project in the organization on this day, by any user or machine identity."
},
GET_SECRETS_AUTH_METHOD_DISTRIBUTION: {
- isSupported:
- "Whether the distribution could be calculated. This endpoint requires the instance to store audit logs in ClickHouse. When audit logs are stored in PostgreSQL this is false and no methods are returned.",
methods:
"One entry for each machine identity authentication method that was used to access a secret value in the last seven days, ordered from most to least used. Methods that were not used are not included.",
authMethod: "The machine identity authentication method that was used to authenticate the accesses.",
count:
"The number of times a secret value was accessed across every project in the organization using this authentication method.",
totalFetches:
- "The total number of times a secret value was accessed by a machine identity across every project in the organization in the last seven days. Accesses by users are not counted.",
- unknownCount:
- "The number of accesses whose authentication method could not be determined, which happens for accesses recorded before the method was captured in audit logs. These are included in the total but not in the methods list."
+ "The total number of times a secret value was accessed by a machine identity across every project in the organization in the last seven days. Accesses by users are not counted, and neither are accesses whose authentication method could not be determined, which happens for accesses recorded before the method was captured in audit logs."
},
GET_SECRETS_COUNTS: {
projects: "The number of secret management projects in the organization.",
diff --git a/backend/src/server/routes/v1/admin-router.ts b/backend/src/server/routes/v1/admin-router.ts
index 4eb4c8cc4c..8628d69f27 100644
--- a/backend/src/server/routes/v1/admin-router.ts
+++ b/backend/src/server/routes/v1/admin-router.ts
@@ -62,7 +62,7 @@ const SanitizedSuperAdminSchema = z.object({
paramsFolderSecretDetectionEnabled: z.boolean().optional(),
isOfflineUsageReportsEnabled: z.boolean().optional(),
isCrossProjectSecretSharingEnabled: z.boolean().optional(),
- // Always returned
+ isClickhouseAuditLogEnabled: z.boolean().optional(),
defaultAuthOrgSlug: z.string().nullable(),
defaultAuthOrgAuthEnforced: z.boolean().nullish(),
defaultAuthOrgAuthMethod: z.string().nullish(),
@@ -97,6 +97,10 @@ export const registerAdminRouter = async (server: FastifyZodProvider) => {
const latestAvailableVersion = await server.services.updateCheck.getAvailableUpdateVersion();
const plan = await server.services.license.getPlan(orgId);
+ const isClickhouseAuditLogEnabled = Boolean(
+ serverEnvs.isClickHouseConfigured && serverEnvs.CLICKHOUSE_AUDIT_LOG_ENABLED
+ );
+
if (!isSuperAdminUser) {
// Only return fields the frontend needs before authentication
return {
@@ -116,6 +120,7 @@ export const registerAdminRouter = async (server: FastifyZodProvider) => {
isPublicSecretSharingDisabled: serverEnvs.DISABLE_PUBLIC_SECRET_SHARING,
licenseServerV2Enabled: serverEnvs.LICENSE_SERVER_V2_MODE === "on",
isCrossProjectSecretSharingEnabled: plan.crossProjectSecretSharing,
+ isClickhouseAuditLogEnabled,
latestAvailableVersion
}
};
@@ -134,6 +139,7 @@ export const registerAdminRouter = async (server: FastifyZodProvider) => {
paramsFolderSecretDetectionEnabled: serverEnvs.PARAMS_FOLDER_SECRET_DETECTION_ENABLED,
isOfflineUsageReportsEnabled: hasOfflineLicense,
isCrossProjectSecretSharingEnabled: plan.crossProjectSecretSharing,
+ isClickhouseAuditLogEnabled,
latestAvailableVersion
}
};
diff --git a/frontend/src/hooks/api/admin/types.ts b/frontend/src/hooks/api/admin/types.ts
index 311675e1f7..52921ded05 100644
--- a/frontend/src/hooks/api/admin/types.ts
+++ b/frontend/src/hooks/api/admin/types.ts
@@ -87,6 +87,7 @@ export type TServerConfig = {
isPublicSecretSharingDisabled?: boolean;
licenseServerV2Enabled?: boolean;
isCrossProjectSecretSharingEnabled?: boolean;
+ isClickhouseAuditLogEnabled?: boolean;
// populated on self-hosted instances when a newer release than the running version exists
latestAvailableVersion?: string | null;
// Super admin-only fields (omitted for non-super-admin callers)
diff --git a/frontend/src/hooks/api/secretInsights/queries.tsx b/frontend/src/hooks/api/secretInsights/queries.tsx
index 26e0654fac..bc7914b462 100644
--- a/frontend/src/hooks/api/secretInsights/queries.tsx
+++ b/frontend/src/hooks/api/secretInsights/queries.tsx
@@ -286,7 +286,7 @@ export const useGetOrgSecretsProjects = (orgId: string, params: TGetOrgSecretsPr
});
};
-export const useGetOrgAuthMethodDistribution = (orgId: string) => {
+export const useGetOrgAuthMethodDistribution = (orgId: string, options?: { enabled?: boolean }) => {
return useQuery({
queryKey: secretInsightsKeys.orgAuthMethodDistribution(orgId),
queryFn: async () => {
@@ -295,7 +295,7 @@ export const useGetOrgAuthMethodDistribution = (orgId: string) => {
);
return data.authMethodDistribution;
},
- enabled: Boolean(orgId),
+ enabled: Boolean(orgId) && (options?.enabled ?? true),
staleTime: INSIGHTS_STALE_TIME
});
};
@@ -314,7 +314,7 @@ export const useGetOrgStaticSecretsUsage = (orgId: string) => {
});
};
-export const useGetOrgSecretsAccessVolume = (orgId: string) => {
+export const useGetOrgSecretsAccessVolume = (orgId: string, options?: { enabled?: boolean }) => {
return useQuery({
queryKey: secretInsightsKeys.orgAccessVolume(orgId),
queryFn: async () => {
@@ -323,7 +323,7 @@ export const useGetOrgSecretsAccessVolume = (orgId: string) => {
);
return data.accessVolume;
},
- enabled: Boolean(orgId),
+ enabled: Boolean(orgId) && (options?.enabled ?? true),
staleTime: INSIGHTS_STALE_TIME
});
};
diff --git a/frontend/src/hooks/api/secretInsights/types.ts b/frontend/src/hooks/api/secretInsights/types.ts
index f5ef1ab4c4..08b56aaa92 100644
--- a/frontend/src/hooks/api/secretInsights/types.ts
+++ b/frontend/src/hooks/api/secretInsights/types.ts
@@ -207,9 +207,7 @@ export type TGetOrgSecretsProjectsDTO = {
};
export type TOrgAuthMethodUsage = {
- isSupported: boolean;
totalFetches: number;
- unknownCount: number;
methods: { authMethod: IdentityAuthMethod; count: number }[];
};
@@ -220,7 +218,6 @@ export type TOrgStaticSecretUsage = {
};
export type TOrgSecretAccessVolume = {
- isSupported: boolean;
days: { date: string; total: number }[];
};
diff --git a/frontend/src/pages/organization/SecretInsightsPage/SecretInsightsPage.tsx b/frontend/src/pages/organization/SecretInsightsPage/SecretInsightsPage.tsx
index 7e6bb0f92b..74ed5ee4df 100644
--- a/frontend/src/pages/organization/SecretInsightsPage/SecretInsightsPage.tsx
+++ b/frontend/src/pages/organization/SecretInsightsPage/SecretInsightsPage.tsx
@@ -13,7 +13,7 @@ import {
TooltipProvider,
TooltipTrigger
} from "@app/components/v3";
-import { OrgPermissionSubjects, useOrganization } from "@app/context";
+import { OrgPermissionSubjects, useOrganization, useServerConfig } from "@app/context";
import { OrgPermissionSecretsManagementInsightsActions } from "@app/context/OrgPermissionContext/types";
import { withPermission } from "@app/hoc";
import { usePopUp } from "@app/hooks";
@@ -44,6 +44,8 @@ const IN_FLIGHT_REPORT_STATUSES = [AuditReportStatus.Pending, AuditReportStatus.
export const SecretInsightsPage = withPermission(
() => {
const { currentOrg } = useOrganization();
+ const { config } = useServerConfig();
+ const isClickhouseEnabled = Boolean(config.isClickhouseAuditLogEnabled);
const { data: summary, isPending: isSummaryPending } = useGetOrgSecretsSummary(currentOrg.id);
// Paginated: pages of 100 (the endpoint maximum); NeedsAttentionCard fetches further
@@ -77,11 +79,12 @@ export const SecretInsightsPage = withPermission(
};
}, [projectsPages]);
const { data: authMethodUsage, isPending: isAuthMethodsPending } =
- useGetOrgAuthMethodDistribution(currentOrg.id);
+ useGetOrgAuthMethodDistribution(currentOrg.id, { enabled: isClickhouseEnabled });
const { data: staticSecretUsage, isPending: isStaticSecretsPending } =
useGetOrgStaticSecretsUsage(currentOrg.id);
const { data: accessVolume, isPending: isAccessVolumePending } = useGetOrgSecretsAccessVolume(
- currentOrg.id
+ currentOrg.id,
+ { enabled: isClickhouseEnabled }
);
const { data: counts } = useGetOrgSecretsCounts(currentOrg.id);
@@ -97,10 +100,9 @@ export const SecretInsightsPage = withPermission(
orgReports?.reports.some((report) => IN_FLIGHT_REPORT_STATUSES.includes(report.status))
);
- // isSupported decides whether the audit-log-backed cards render at all
- // (e.g. self-hosted instances without ClickHouse). While the auth methods query is
- // pending we keep its grid slot so the row doesn't reflow when the card appears.
- const showAuthMethodsSlot = isAuthMethodsPending || Boolean(authMethodUsage?.isSupported);
+ const isAuthMethodsLoading = isClickhouseEnabled && isAuthMethodsPending;
+ const isAccessVolumeLoading = isClickhouseEnabled && isAccessVolumePending;
+ const showAuthMethodsSlot = isAuthMethodsLoading || Boolean(authMethodUsage);
const headerStats: { label: string; value: number; icon: ReactNode }[] = counts
? [
@@ -223,8 +225,8 @@ export const SecretInsightsPage = withPermission(
showAuthMethodsSlot ? "grid gap-4 xl:grid-cols-[1fr_1.35fr]" : "grid gap-4"
}
>
- {isAuthMethodsPending && <Skeleton className="h-[320px]" />}
- {!isAuthMethodsPending && authMethodUsage?.isSupported && (
+ {isAuthMethodsLoading && <Skeleton className="h-[320px]" />}
+ {!isAuthMethodsLoading && authMethodUsage && (
<AuthMethodsCard data={authMethodUsage} />
)}
{isStaticSecretsPending && <Skeleton className="h-[320px]" />}
@@ -232,8 +234,8 @@ export const SecretInsightsPage = withPermission(
<StaticSecretPresenceCard data={staticSecretUsage} />
)}
</div>
- {isAccessVolumePending && <Skeleton className="h-[300px]" />}
- {!isAccessVolumePending && accessVolume?.isSupported && (
+ {isAccessVolumeLoading && <Skeleton className="h-[300px]" />}
+ {!isAccessVolumeLoading && accessVolume && (
<SecretAccessVolumeCard data={accessVolume} />
)}
</div>
@@ -242,7 +244,7 @@ export const SecretInsightsPage = withPermission(
<RequestOrgAuditReportModal
isOpen={popUp.requestOrgReport.isOpen}
onOpenChange={(isOpen) => handlePopUpToggle("requestOrgReport", isOpen)}
- isAuditLogSupported={Boolean(accessVolume?.isSupported)}
+ isAuditLogSupported={isClickhouseEnabled}
/>
</>
);
diff --git a/frontend/src/pages/organization/SecretInsightsPage/components/AuthMethodsCard.tsx b/frontend/src/pages/organization/SecretInsightsPage/components/AuthMethodsCard.tsx
index b5ca896b99..6bf0328eb6 100644
--- a/frontend/src/pages/organization/SecretInsightsPage/components/AuthMethodsCard.tsx
+++ b/frontend/src/pages/organization/SecretInsightsPage/components/AuthMethodsCard.tsx
@@ -1,5 +1,5 @@
import { useMemo } from "react";
-import { InfoIcon, TriangleAlertIcon } from "lucide-react";
+import { TriangleAlertIcon } from "lucide-react";
import {
Alert,
@@ -11,14 +11,11 @@ import {
CardTitle,
Empty,
EmptyHeader,
- EmptyTitle,
- Tooltip,
- TooltipContent,
- TooltipTrigger
+ EmptyTitle
} from "@app/components/v3";
import { IdentityAuthMethod, identityAuthToNameMap, TOrgAuthMethodUsage } from "@app/hooks/api";
-import { CHART_COLORS, UNKNOWN_SERIES_COLOR } from "./chartColors";
+import { CHART_COLORS } from "./chartColors";
type Segment = {
key: string;
@@ -26,7 +23,6 @@ type Segment = {
count: number;
pct: number;
color: string;
- isUnknown: boolean;
};
const humanizeAuthMethod = (authMethod: string) =>
@@ -40,29 +36,15 @@ export const AuthMethodsCard = ({ data }: { data: TOrgAuthMethodUsage }) => {
const segments = useMemo<Segment[]>(() => {
if (data.totalFetches === 0) return [];
- const methodSegments: Segment[] = [...data.methods]
+ return [...data.methods]
.sort((a, b) => b.count - a.count)
.map((method, index) => ({
key: method.authMethod,
label: humanizeAuthMethod(method.authMethod),
count: method.count,
pct: (method.count / data.totalFetches) * 100,
- color: CHART_COLORS[index % CHART_COLORS.length],
- isUnknown: false
+ color: CHART_COLORS[index % CHART_COLORS.length]
}));
-
- if (data.unknownCount > 0) {
- methodSegments.push({
- key: "unknown",
- label: "Unknown",
- count: data.unknownCount,
- pct: (data.unknownCount / data.totalFetches) * 100,
- color: UNKNOWN_SERIES_COLOR,
- isUnknown: true
- });
- }
-
- return methodSegments;
}, [data]);
const staticTokenPct = useMemo(() => {
@@ -112,22 +94,7 @@ export const AuthMethodsCard = ({ data }: { data: TOrgAuthMethodUsage }) => {
className="size-2.5 shrink-0 rounded-full"
style={{ backgroundColor: segment.color }}
/>
- <span className="flex-1 text-sm">
- {segment.label}
- {segment.isUnknown && (
- <Tooltip>
- <TooltipTrigger asChild>
- <InfoIcon className="mb-0.5 ml-1 inline size-3 text-muted" />
- </TooltipTrigger>
- <TooltipContent>
- <p className="max-w-xs text-xs">
- Only new requests will display the auth method. Older requests may not
- have this information recorded.
- </p>
- </TooltipContent>
- </Tooltip>
- )}
- </span>
+ <span className="flex-1 text-sm">{segment.label}</span>
<span className="text-sm text-muted">
{segment.count.toLocaleString()} {segment.count === 1 ? "fetch" : "fetches"}
</span>
diff --git a/frontend/src/pages/organization/SecretInsightsPage/components/chartColors.ts b/frontend/src/pages/organization/SecretInsightsPage/components/chartColors.ts
index 69a8107f58..d936a58f03 100644
--- a/frontend/src/pages/organization/SecretInsightsPage/components/chartColors.ts
+++ b/frontend/src/pages/organization/SecretInsightsPage/components/chartColors.ts
@@ -11,6 +11,3 @@ export const CHART_COLORS = [
"var(--color-org)",
"var(--color-danger)"
];
-
-// Reserved for the "Unknown" distribution segment so it never collides with a named series.
-export const UNKNOWN_SERIES_COLOR = "var(--color-muted)";