test(io): move jwt secret length test to test_cli.py

Closes #4316.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
This commit is contained in:
Taimoor Zaeem
2025-09-11 12:01:21 -05:00
committed by Steve Chavez
parent cddfb6cf5e
commit 59ca9e7f0d
2 changed files with 9 additions and 13 deletions
+9
View File
@@ -294,3 +294,12 @@ def test_jwt_aud_config_set_to_invalid_uri(defaultenv):
error = cli(["--dump-config"], env=env, expect_error=True)
assert "jwt-aud should be a string or a valid URI" in error
def test_jwt_secret_min_length(defaultenv):
"Should log error and not load the config when the secret is shorter than the minimum admitted length"
env = {**defaultenv, "PGRST_JWT_SECRET": "short_secret"}
error = cli(["--dump-config"], env=env, expect_error=True)
assert "The JWT secret must be at least 32 characters long." in error