test(gateway): use valid API server key in env override test (#70274)

Keep the explicit-disable regression test on the usable-key path after
the API server loader began rejecting weak API_SERVER_KEY values.
This commit is contained in:
ethernet 2026-07-23 15:56:28 -04:00 committed by GitHub
parent c4f5a45d5d
commit 75afaf46da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -2472,10 +2472,11 @@ class TestApiServerEnvOverride:
},
)
with patch.dict(os.environ, {"API_SERVER_KEY": "secret-key"}, clear=True):
api_server_key = "secret-key-at-least-16"
with patch.dict(os.environ, {"API_SERVER_KEY": api_server_key}, clear=True):
_apply_env_overrides(config)
# Explicit disable wins over the env-var presence.
assert config.platforms[Platform.API_SERVER].enabled is False
# The key is still wired through for the shared listener.
assert config.platforms[Platform.API_SERVER].extra.get("key") == "secret-key"
assert config.platforms[Platform.API_SERVER].extra.get("key") == api_server_key