fix: impersonated role applying superuser settings

This commit is contained in:
steve-chavez
2023-08-09 20:05:22 -05:00
committed by Steve Chavez
parent fbf9bf21c2
commit 5ce020d5bc
4 changed files with 23 additions and 2 deletions
+12
View File
@@ -1051,3 +1051,15 @@ def test_log_postgrest_version(defaultenv):
"Starting PostgREST %s..." % version
in postgrest.process.stdout.readline().decode()
)
def test_succeed_w_role_having_superuser_settings(defaultenv):
"Should succeed when having superuser settings on the impersonated role"
env = {**defaultenv, "PGRST_DB_CONFIG": "true", "PGRST_JWT_SECRET": SECRET}
with run(stdin=SECRET.encode(), env=env) as postgrest:
headers = jwtauthheader({"role": "postgrest_test_w_superuser_settings"}, SECRET)
response = postgrest.session.get("/projects", headers=headers)
print(response.text)
assert response.status_code == 200