fix: stop sending orgId on file and token calls - #1
Merged
Conversation
Replace ad-hoc GAQL/SQL with pick-based querying against the app's semantic datasets: - buron datasets list|describe|query (-m/-d/-f field:op:value/--from/--to/ --granularity/--sort/--limit/--spec) - buron sql <select> — read-only warehouse escape hatch - buron queries create --spec (structured SemanticQuery, replaces -s/-q raw strings); queries list --dataset; run returns the QueryResult envelope - buron dashboards add <dashboardId> <queryId> - --json everywhere for scripting - DELETE buron query (raw GAQL) — targets the retired /api/v1/query Types mirror the app's SemanticQuery contract; server validates. tsc 0, biome clean, build green. Bumped to 0.3.0 (breaking).
The server now derives the organization from the Team row and verifies the caller's membership (requireCliTeamAccess), so orgId in the request body is ignored. Sending it was never authorization - before the guard landed it was the value the server trusted, which is what made a spoofed orgId a cross-tenant read. Drops the parameter from api.files.* and generateToken plus their call sites; teamId alone identifies the target now. No behaviour change against a current server, and older servers still accept these payloads because they read orgId from the session first. Leaves data.* (datasets, warehouse SQL) untouched: those endpoints do not exist server-side yet, so their payload contract is still undecided.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the S0 membership guard in
buron(kayvink/buron#201).The server now derives the organization from the Team row and verifies the caller's membership, so
orgIdin the request body is ignored. Sending it was never authorization — before the guard landed, it was the value the server trusted, which is exactly what made a spoofedorgIda cross-tenant read.Changes
api.files.*(read/write/append/list/glob/grep/delete/move/replace):orgIdparameter and body field removed;teamIdalone identifies the targetgenerateToken: same, and/api/v1/tokensnow scopes the minted key to the org it derives from the teamsrc/commands/file.tsupdatedNot touched
data.*(datasets, warehouse SQL) still sendorgId. Those endpoints don't exist in the server yet, so their payload contract is undecided — worth revisiting when the semantic-datasets work lands.Compatibility
No behaviour change against a current server. Older servers also still work, since they read the org from the session before falling back to the body.
Typecheck and build clean.
🤖 Generated with Claude Code