Skip to content

Restore authenticated account attribution in PostHog - #141

Merged
jackshim415 merged 2 commits into
mainfrom
jackshim415/lvt-334-safe-request-identity
Nov 22, 2026
Merged

jackshim415 merged 2 commits into
mainfrom
jackshim415/lvt-334-safe-request-identity

Conversation

@jackshim415

Copy link
Copy Markdown
Contributor

What changed

Restore stable account attribution for verified Dashboard and API requests in the existing PostHog response event, along with app version, OS, build, and legacy $pathname reporting. Raw team codes, credentials, URLs, query strings, request/response bodies, names, emails, and IP addresses stay out. Collection requests remain anonymous because shared team access does not prove an individual scouter's identity.

Refs: LVT-334, #128.

Areas affected

  • Server

Contracts and data

  • No API, report-schema, authentication, deep-link, season-metric, or database contract changed
  • Tenant and source-team visibility was reviewed
  • No credentials, production data, or private scouting notes are included

Verification

  • Server: DATABASE_URL=<local unit test URL> npm test (1,457 passed), npm run build, npm run typecheck, npm run typecheck:test, and npm run lint (no errors; 79 warnings in unchanged files).
  • Focused PostHog reporter suite: 20 passed; tests check both verified auth types and prevent team-code/payload capture. Tests mock PostHog; no live events were sent.
  • Repository: ./scripts/check-structure.sh and git diff --check passed.

Deployment

No migration, environment variable, or platform configuration changes. PostHog event changes take effect on the next Server deploy.

Recover account-level support and app-version breakdowns without forwarding team codes, credentials, raw URLs, or payloads.

Refs: LVT-334
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-22T15:56:55.262415Z
We couldn’t complete this review. Comment @codex review to try again.
dfb3d8b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@railway-app
railway-app Bot temporarily deployed to lovat / lovat-pr-141 November 22, 2026 15:57 Destroyed
@railway-app

railway-app Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the lovat-pr-141 environment in lovat

Service Status Web Updated
dashboard 😴 Sleeping (View Logs) Web Nov 22, 2026 at 4:07 pm UTC
learn 😴 Sleeping (View Logs) Web Nov 22, 2026 at 4:07 pm UTC
website 😴 Sleeping (View Logs) Web Nov 22, 2026 at 4:04 pm UTC
api ✅ Success (View Logs) Web Nov 22, 2026 at 4:03 pm UTC
worker ✅ Success (View Logs) Nov 22, 2026 at 4:03 pm UTC
1 service not affected by this PR
  • support

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Lovat AI review

Status: completed · Model: z-ai/glm-5.3-flash · Findings: 0

Reviewed commit: 7e9bd14a43478205e581d2e360fced53e30b8578

Critical: 0 · High: 0 · Medium: 0 · Low: 0

Overall assessment

This diff restores authenticated attribution in PostHog telemetry with careful allowlisting: distinct IDs come only from requireAuth-validated JWT/API-key callers, person-profile processing is enabled only in that case, client-supplied hints are strictly pattern-validated, and Collection-style requests remain anonymous. The documentation and tests match the implementation, and no secrets, headers, or identifiers beyond the documented account attributes are captured. No concrete defects were identified in the changed lines.

No high-confidence issues were found in the reviewed changes.

Review details

  • Review batches: 1
  • Diff characters reviewed: 14,441
  • Tokens: 6,089 prompt + 534 completion
  • Estimated inference cost: $0.0009

Limitations

  • The reviewer examined only changed lines and their diff context, not the whole repository.

@github-actions

Copy link
Copy Markdown
Contributor

📱 Connect your app to this PR deployment

Scan a QR code to use this PR's Server API. Worker changes use the same API;
the Worker has no public app endpoint.

Server URL: https://api-lovat-pr-141.up.railway.app

Lovat Collection

QR code — Lovat Collection

lovat-collection://set-url?u=https%3A%2F%2Fapi-lovat-pr-141.up.railway.app

Lovat Dashboard

QR code — Lovat Dashboard

com.frc8033.lovatdashboard:///set-url?u=https%3A%2F%2Fapi-lovat-pr-141.up.railway.app

@railway-app
railway-app Bot temporarily deployed to lovat / lovat-pr-141 November 22, 2026 16:02 Destroyed
@jackshim415
jackshim415 merged commit b5762cc into main Nov 22, 2026
30 checks passed

This branch was successfully deployed

No deployments
lovat / lovat-pr-141 — 7e9bd14a Deployed Nov 22, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant