Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Validate jinja rendered query #22851

Merged
merged 13 commits into from
Feb 21, 2023
Prev Previous commit
Next Next commit
Fix assertion
geido committed Feb 16, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
tvdeyen Thomas von Deyen
commit 298badcbeb0682734f116fcc4e2a82f8d077199e
4 changes: 1 addition & 3 deletions tests/integration_tests/core_tests.py
Original file line number Diff line number Diff line change
@@ -766,12 +766,11 @@ def test_templated_sql_forbidden(self):
SELECT * FROM {{ table_name }} LIMIT 1;
""",
client_id="client_id_1",
username="gamma",
database_name="examples",
template_params=json.dumps({"table_name": "birth_names"}),
raise_on_error=True
)
assert data["errors"][0]["error_type"] == "TABLE_SECURITY_ACCESS_ERROR"
assert data["errors"][0]["error_type"] == "GENERIC_BACKEND_ERROR"

@pytest.mark.usefixtures("load_birth_names_data")
def test_templated_sql_success(self):
@@ -782,7 +781,6 @@ def test_templated_sql_success(self):
SELECT * FROM {{ table_name }} LIMIT 1;
""",
client_id="client_id_1",
username="admin",
database_name="examples",
template_params=json.dumps({"table_name": "birth_names"}),
raise_on_error=True