Skip to content

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

fix: use req.permission.orgId for SSO telemetry events, use SecretRotation enum for type property

Devin AIf0940deb4898
diff --git a/backend/src/ee/routes/v1/ldap-router.ts b/backend/src/ee/routes/v1/ldap-router.ts
index 4032c3f532..8e7e6caada 100644
--- a/backend/src/ee/routes/v1/ldap-router.ts
+++ b/backend/src/ee/routes/v1/ldap-router.ts
@@ -228,7 +228,7 @@ export const registerLdapRouter = async (server: FastifyZodProvider) => {
.sendPostHogEvents({
event: PostHogEventTypes.SSOConfigured,
distinctId: getTelemetryDistinctId(req),
- organizationId: req.body.organizationId,
+ organizationId: req.permission.orgId,
properties: {
provider: "ldap",
action: "create"
@@ -289,7 +289,7 @@ export const registerLdapRouter = async (server: FastifyZodProvider) => {
.sendPostHogEvents({
event: PostHogEventTypes.SSOConfigured,
distinctId: getTelemetryDistinctId(req),
- organizationId: req.body.organizationId,
+ organizationId: req.permission.orgId,
properties: {
provider: "ldap",
action: "update"
diff --git a/backend/src/ee/routes/v1/oidc-router.ts b/backend/src/ee/routes/v1/oidc-router.ts
index 36f88a5046..e7fd5abade 100644
--- a/backend/src/ee/routes/v1/oidc-router.ts
+++ b/backend/src/ee/routes/v1/oidc-router.ts
@@ -284,7 +284,7 @@ export const registerOidcRouter = async (server: FastifyZodProvider) => {
.sendPostHogEvents({
event: PostHogEventTypes.SSOConfigured,
distinctId: getTelemetryDistinctId(req),
- organizationId: req.body.organizationId,
+ organizationId: req.permission.orgId,
properties: {
provider: "oidc",
action: "update"
@@ -421,7 +421,7 @@ export const registerOidcRouter = async (server: FastifyZodProvider) => {
.sendPostHogEvents({
event: PostHogEventTypes.SSOConfigured,
distinctId: getTelemetryDistinctId(req),
- organizationId: req.body.organizationId,
+ organizationId: req.permission.orgId,
properties: {
provider: "oidc",
action: "create"
diff --git a/backend/src/ee/routes/v1/saml-router.ts b/backend/src/ee/routes/v1/saml-router.ts
index 0f0be11d1c..7c3b45a519 100644
--- a/backend/src/ee/routes/v1/saml-router.ts
+++ b/backend/src/ee/routes/v1/saml-router.ts
@@ -387,7 +387,7 @@ export const registerSamlRouter = async (server: FastifyZodProvider) => {
.sendPostHogEvents({
event: PostHogEventTypes.SSOConfigured,
distinctId: getTelemetryDistinctId(req),
- organizationId: req.body.organizationId,
+ organizationId: req.permission.orgId,
properties: {
provider: authProvider,
action: "create"
@@ -452,7 +452,7 @@ export const registerSamlRouter = async (server: FastifyZodProvider) => {
.sendPostHogEvents({
event: PostHogEventTypes.SSOConfigured,
distinctId: getTelemetryDistinctId(req),
- organizationId: req.body.organizationId,
+ organizationId: req.permission.orgId,
properties: {
provider: authProvider ?? "saml",
action: "update"
diff --git a/backend/src/services/telemetry/telemetry-types.ts b/backend/src/services/telemetry/telemetry-types.ts
index 1e513641f7..e8ec446066 100644
--- a/backend/src/services/telemetry/telemetry-types.ts
+++ b/backend/src/services/telemetry/telemetry-types.ts
@@ -13,6 +13,7 @@ import {
} from "@app/ee/services/audit-log/audit-log-types";
import { EnforcementLevel } from "@app/lib/types";
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
+import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";
export enum PostHogEventTypes {
SecretPush = "secrets pushed",
@@ -581,7 +582,7 @@ export type TSecretRotationV2CreatedEvent = {
event: PostHogEventTypes.SecretRotationV2Created;
properties: {
rotationId: string;
- type: string;
+ type: SecretRotation;
projectId: string;
environment: string;
secretPath: string;
@@ -592,7 +593,7 @@ export type TSecretRotationV2DeletedEvent = {
event: PostHogEventTypes.SecretRotationV2Deleted;
properties: {
rotationId: string;
- type: string;
+ type: SecretRotation;
projectId: string;
environment: string;
secretPath: string;
@@ -603,7 +604,7 @@ export type TSecretRotationV2ExecutedEvent = {
event: PostHogEventTypes.SecretRotationV2Executed;
properties: {
rotationId: string;
- type: string;
+ type: SecretRotation;
projectId: string;
environment: string;
secretPath: string;