Repository navigation
Do not run URL-supplied parameters on page view - #727
Open
chrisclark wants to merge 1 commit into
Open
chrisclark wants to merge 1 commit into
chrisclark wants to merge 1 commit into
Conversation
A query link carrying parameters (?params=id:5) executed the query on a plain page view. Those parameter values travel with the link rather than coming from the person who opened it, so a shared link ran SQL in the visitor's session with nothing more than a click on the link -- no Save & Run, no review of the parameters. Parameterized queries loaded from the URL now render without executing, which is what EXPLORER_AUTORUN_QUERY_WITH_PARAMS=False already did for every parameterized query. The setting keeps its documented meaning for queries whose parameters did not come from the URL, and queries with no URL parameters are unaffected. This complements binding parameter values (they can no longer change the SQL) by removing the remaining case where merely opening a shared link runs a query the visitor did not ask for. The detail page renders the values on request, so no results are lost; the user just has to ask for them.
This branch has not been deployed
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.
Summary
Stops a shared query link from executing SQL in the visitor's session. High.
QueryView.getran the query on a plain page view whenevershowwas truthy, which it is by default:Parameters in the URL (
?params=id:5) are documented as the way to share a parameterized query, so a link carries the values that make it run. Opening such a link executed the query immediately, in the session of whoever clicked it, with no Save & Run and no review of the parameters.Correction to my earlier report: I initially listed "
?show=1overridesEXPLORER_AUTORUN_QUERY_WITH_PARAMS=False" as part of this. On re-testing that is not true — the setting does suppress the run, and I had validated it badly the first time. It is corrected here rather than left in the history. The real issue is narrower: with the setting left at its default (True), a URL-parameterized link always runs.Fix
Parameterized queries loaded from the URL now render without executing — the same behaviour
EXPLORER_AUTORUN_QUERY_WITH_PARAMS=Falsealready gives, applied to the case where the parameters did not come from the person viewing. The setting keeps its documented meaning, and queries with no URL parameters still autorun as before.This complements #723. Binding parameter values means a parameter can no longer change the SQL; this removes the remaining case where merely opening a shared link runs a query the visitor never asked for.
Nothing is lost: the detail page renders the parameter values on request, so the user clicks Save & Run to get results.
Tests
EXPLORER_AUTORUN_QUERY_WITH_PARAMS=Trueexplicitly set (the actual default path);Docs updated in
install.rstnext to theEXPLORER_AUTORUN_QUERY_WITH_PARAMSentry.Full suite: 297 tests, OK.
ruff check explorer/: clean.