Dev#99
Conversation
…race, scoped clearClients
…eAITokenUsageDataSchema
…dularization) Phase 1 — SQL Dialect Abstraction: - fieldRegistry.ts: single source of truth for event field definitions - sqlDialect.ts: common interface (buildSelect, buildWhere, getTotalCount) - postgresDialect.ts / clickHouseDialect.ts: dialect implementations - queryEvents.ts: unified handler that picks dialect via STORAGE_ADAPTER - Both PG and CH handlers now thin re-exports from common/queryEvents Phase 3 — Data Engine Modularization: - Extract dataQuery module from routes/gRPC/data/query into storage/query/ - Explicit field alias registry with auto-derived cast types from Drizzle metadata - Thin handler in routes/gRPC/data/query delegates to executeDataQuery/getDataTable - hasMore support in DataQueryResult
0xanshu/project
…update proto submodule
chore: rename SCRAWN_KEY to MASTER_API_KEY, add MASTER_API_KEY_HASH, …
Refactor/analytics
Feat/dodo products creation
Greptile SummaryThis PR adds project-scoped backend support across auth, billing, and query paths. The main changes are:
Confidence Score: 4/5The query-events path needs a tenant-scope fix before merging. Authenticated event queries can read rows outside the caller's project. The problem affects list, aggregation, and count queries in both SQL dialects. The reviewed HTTP project and payment paths otherwise use projectId consistently. src/storage/adapter/common/queryEvents.ts, src/storage/adapter/common/postgresDialect.ts, src/storage/adapter/common/clickHouseDialect.ts
What T-Rex did
Important Files Changed
Reviews (1): Last reviewed commit: "Merge pull request #98 from 0xanshu/feat..." | Re-trigger Greptile |
| return await dialect.executeAggregationQuery(request, filtered); | ||
| } | ||
| return await dialect.executeListQuery(request, filtered); |
There was a problem hiding this comment.
Query Events Ignore Tenant Scope
When any API key calls queryEvents, the authenticated projectId is accepted by this function but never reaches the Postgres or ClickHouse dialects. The generated list, aggregation, and count queries only use request filters, so a valid key can receive events from other projects and modes in the shared event tables.
Artifacts
Repro: Bun test harness instrumenting dialect calls from handleQueryEvents
- Contains supporting evidence from the run (text/typescript; charset=utf-8).
Repro: test output showing unscoped list and aggregation dialect arguments
- Keeps the command output available without making the summary code-heavy.
No description provided.