Commit Graph

13 Commits

Author SHA1 Message Date
Evan
63603ec369 fix(sqllab): keep RLS schema probe out of the session + always run the schema gate
Addresses review feedback on the cost-estimate security-parity path:

- The transient Query built to resolve the per-query schema joined the
  session via the `database` backref's `cascade="all, delete-orphan"`.
  With no `client_id` (nullable=False) it autoflushed into an IntegrityError
  the moment `apply_rls` issued its own session query, 500-ing every
  RLS-enabled estimate that references a table. Mirror the probe pattern in
  `SupersetSecurityManager.raise_for_access`: set `client_id`/`user_id` and
  `db.session.expunge` the probe.
- `get_default_schema_for_query` was skipped whenever the caller pinned a
  schema, bypassing the engine's per-query gate (e.g. Postgres rejecting
  `SET search_path`) that the executor runs unconditionally. Always resolve
  through it; an explicit schema still wins as the RLS predicate target.

Unit tests patch the session (so they can't see the autoflush); add an
integration test exercising a real session + real `apply_rls` that would
have caught the regression, and flip the explicit-schema test to assert the
gate now runs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 14:59:51 -07:00
Shaitan
f49310b8ff fix(sql-lab): apply access check in SqlExecutionResultsCommand (#38952)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 16:47:15 -04:00
Maxime Beauchemin
cb27d5fe8d chore: proper current_app.config proxy usage (#34345)
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-31 19:27:42 -07:00
Ahmed Habeeb
43775e9373 fix(sqllab_export): manually encode CSV output to support utf-8-sig (#34235) 2025-07-23 18:44:56 -07:00
Evan Rusackas
90651dfe3e fix(dev/ci): pre-commit fixes galore (#32352) 2025-02-24 11:26:45 -07:00
Maxime Beauchemin
e51b95ffa8 chore: enforce more ruff rules (#31447)
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
2024-12-18 17:41:34 -08:00
Maxime Beauchemin
2d63722150 chore: set up ruff as a new linter/formatter (#28158) 2024-04-24 17:19:53 -07:00
John Bodley
07bcfa9b5f chore(command): Organize Commands according to SIP-92 (#25850) 2023-11-22 16:55:54 -03:00
John Bodley
a4d5d7c6b9 chore(pre-commit): Add pyupgrade and pycln hooks (#24197) 2023-06-01 12:01:10 -07:00
Hugh A. Miles II
8fa77adf9a chore: Hugh/migrate estimate query cost to v1 (#23226)
Co-authored-by: Diego Medina <diegomedina24@gmail.com>
2023-03-17 18:02:25 -06:00
Daniel Vaz Gaspar
4b03d2553c fix: missing __init__ on module sqllab commands (#23107) 2023-02-17 11:08:14 +00:00
Diego Medina
e5a4c78dc7 chore: Migrate /superset/csv/<client_id> to API v1 (#22913) 2023-02-15 10:48:24 +00:00
Diego Medina
b94052e438 chore: migrate /sql_json and /results to apiv1 (#22809) 2023-01-30 11:02:34 -05:00