From 8eb6bb2a95b48e38a0eb4c87d0021a08a10aa8c3 Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Thu, 22 Jan 2026 10:36:52 -0800 Subject: [PATCH] dont include posture in repsonse if not licensed or subscribed --- server/routers/client/getClient.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/server/routers/client/getClient.ts b/server/routers/client/getClient.ts index e5b1c03e..1171430f 100644 --- a/server/routers/client/getClient.ts +++ b/server/routers/client/getClient.ts @@ -12,6 +12,7 @@ import { fromError } from "zod-validation-error"; import { OpenAPITags, registry } from "@server/openApi"; import { getUserDeviceName } from "@server/db/names"; import { build } from "@server/build"; +import { isLicensedOrSubscribed } from "@server/lib/isLicencedOrSubscribed"; const getClientSchema = z.strictObject({ clientId: z @@ -250,12 +251,18 @@ export async function getClient( : null; // Build posture data if available (platform-specific) + // Only return posture data if org is licensed/subscribed let postureData: PostureData | null = null; if (build !== "oss") { - postureData = getPlatformPostureData( - client.currentFingerprint?.platform || null, - client.currentFingerprint + const isOrgLicensed = await isLicensedOrSubscribed( + client.clients.orgId ); + if (isOrgLicensed) { + postureData = getPlatformPostureData( + client.currentFingerprint?.platform || null, + client.currentFingerprint + ); + } } const data: GetClientResponse = {