Skip to content

Commit 2da6f50

Browse files
fix: address review comments - add organizationId to rotation events, remove redundant orgId, rename gatewayId
Co-Authored-By: arsh <[email protected]>
1 parent ce57d3b commit 2da6f50

File tree

7 files changed

+8
-18
lines changed

7 files changed

+8
-18
lines changed

backend/src/ee/routes/v1/gateway-router.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ export const registerGatewayRouter = async (server: FastifyZodProvider) => {
8888
distinctId: getTelemetryDistinctId(req),
8989
organizationId: req.permission.orgId,
9090
properties: {
91-
gatewayId: gatewayCertificates.serialNumber,
92-
identityId: req.permission.id,
93-
orgId: req.permission.orgId
91+
certificateSerialNumber: gatewayCertificates.serialNumber,
92+
identityId: req.permission.id
9493
}
9594
})
9695
.catch(() => {});

backend/src/ee/routes/v1/ldap-router.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ export const registerLdapRouter = async (server: FastifyZodProvider) => {
230230
distinctId: getTelemetryDistinctId(req),
231231
organizationId: req.body.organizationId,
232232
properties: {
233-
orgId: req.body.organizationId,
234233
provider: "ldap",
235234
action: "create"
236235
}
@@ -292,7 +291,6 @@ export const registerLdapRouter = async (server: FastifyZodProvider) => {
292291
distinctId: getTelemetryDistinctId(req),
293292
organizationId: req.body.organizationId,
294293
properties: {
295-
orgId: req.body.organizationId,
296294
provider: "ldap",
297295
action: "update"
298296
}

backend/src/ee/routes/v1/oidc-router.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ export const registerOidcRouter = async (server: FastifyZodProvider) => {
286286
distinctId: getTelemetryDistinctId(req),
287287
organizationId: req.body.organizationId,
288288
properties: {
289-
orgId: req.body.organizationId,
290289
provider: "oidc",
291290
action: "update"
292291
}
@@ -424,7 +423,6 @@ export const registerOidcRouter = async (server: FastifyZodProvider) => {
424423
distinctId: getTelemetryDistinctId(req),
425424
organizationId: req.body.organizationId,
426425
properties: {
427-
orgId: req.body.organizationId,
428426
provider: "oidc",
429427
action: "create"
430428
}

backend/src/ee/routes/v1/saml-router.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ export const registerSamlRouter = async (server: FastifyZodProvider) => {
389389
distinctId: getTelemetryDistinctId(req),
390390
organizationId: req.body.organizationId,
391391
properties: {
392-
orgId: req.body.organizationId,
393392
provider: authProvider,
394393
action: "create"
395394
}
@@ -456,7 +455,6 @@ export const registerSamlRouter = async (server: FastifyZodProvider) => {
456455
distinctId: getTelemetryDistinctId(req),
457456
organizationId: req.body.organizationId,
458457
properties: {
459-
orgId: req.body.organizationId,
460458
provider: authProvider,
461459
action: "update"
462460
}

backend/src/ee/routes/v2/secret-rotation-v2-routers/secret-rotation-v2-endpoints.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ export const registerSecretRotationEndpoints = <
262262
.sendPostHogEvents({
263263
event: PostHogEventTypes.SecretRotationV2Created,
264264
distinctId: getTelemetryDistinctId(req),
265+
organizationId: req.permission.orgId,
265266
properties: {
266267
rotationId: secretRotation.id,
267268
type,
@@ -379,6 +380,7 @@ export const registerSecretRotationEndpoints = <
379380
.sendPostHogEvents({
380381
event: PostHogEventTypes.SecretRotationV2Deleted,
381382
distinctId: getTelemetryDistinctId(req),
383+
organizationId: req.permission.orgId,
382384
properties: {
383385
rotationId,
384386
type,
@@ -482,6 +484,7 @@ export const registerSecretRotationEndpoints = <
482484
.sendPostHogEvents({
483485
event: PostHogEventTypes.SecretRotationV2Executed,
484486
distinctId: getTelemetryDistinctId(req),
487+
organizationId: req.permission.orgId,
485488
properties: {
486489
rotationId,
487490
type,

backend/src/server/routes/v1/app-connection-routers/app-connection-endpoints.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,7 @@ export const registerAppConnectionEndpoints = <T extends TAppConnection, I exten
331331
properties: {
332332
appConnectionId: appConnection.id,
333333
app,
334-
method: method as string,
335-
orgId: req.permission.orgId
334+
method: method as string
336335
}
337336
})
338337
.catch(() => {});
@@ -454,8 +453,7 @@ export const registerAppConnectionEndpoints = <T extends TAppConnection, I exten
454453
organizationId: req.permission.orgId,
455454
properties: {
456455
appConnectionId: connectionId,
457-
app,
458-
orgId: req.permission.orgId
456+
app
459457
}
460458
})
461459
.catch(() => {});

backend/src/services/telemetry/telemetry-types.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,6 @@ export type TDynamicSecretLeaseRenewedEvent = {
554554
export type TSSOConfiguredEvent = {
555555
event: PostHogEventTypes.SSOConfigured;
556556
properties: {
557-
orgId: string;
558557
provider: string;
559558
action: "create" | "update";
560559
};
@@ -566,7 +565,6 @@ export type TAppConnectionCreatedEvent = {
566565
appConnectionId: string;
567566
app: string;
568567
method: string;
569-
orgId: string;
570568
};
571569
};
572570

@@ -575,7 +573,6 @@ export type TAppConnectionDeletedEvent = {
575573
properties: {
576574
appConnectionId: string;
577575
app: string;
578-
orgId: string;
579576
};
580577
};
581578

@@ -611,9 +608,8 @@ export type TSecretRotationV2ExecutedEvent = {
611608
export type TGatewayCreatedEvent = {
612609
event: PostHogEventTypes.GatewayCreated;
613610
properties: {
614-
gatewayId: string;
611+
certificateSerialNumber: string;
615612
identityId: string;
616-
orgId: string;
617613
};
618614
};
619615

0 commit comments

Comments
 (0)