Skip to content

Update check_restricted_query_access to pass active engine and environment - #1734

Merged
jasoncoffman merged 2 commits into
pinterest:masterfrom
jasoncoffman:auth/safe-engine-update
Sep 15, 2026
Merged

jasoncoffman merged 2 commits into
pinterest:masterfrom
jasoncoffman:auth/safe-engine-update

Conversation

@jasoncoffman

@jasoncoffman jasoncoffman commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Problem

The existing check_restricted_query_access function only exposes SAFE_ENVIRONMENTS and SAFE_QUERY_ENGINES as knobs for controlling whether or not a query access should be restricted. This prevents more fine-grained control of when/why query access may be restricted.

Solution

Add generic support for kwargs in check_restricted_query_access and allow function implementations to use environment and engine context when available to check if query access should be restricted for the given engine_id or environment_id.

The enables engines/environments not in the SAFE_* list to be conditionally allowed via the check_restricted_query_access implementation

Test Plans

Unit tests added; verified manually

@jasoncoffman
jasoncoffman marked this pull request as ready for review September 15, 2026 17:31
@jasoncoffman
jasoncoffman merged commit 26cfb08 into pinterest:master Sep 15, 2026
6 checks passed
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.

3 participants