test_security.py 514 B

1234567891011121314
  1. from dataclasses import replace
  2. from data_query_agent.codex_runtime import CodexRuntime
  3. from data_query_agent.config import Settings
  4. def test_codex_child_environment_excludes_data_credentials(tmp_path) -> None:
  5. settings = replace(Settings.load(), runtime_dir=tmp_path)
  6. env = CodexRuntime(settings)._child_env()
  7. assert "ODPS_ACCESS_ID" not in env
  8. assert "ODPS_ACCESS_KEY" not in env
  9. assert "FEISHU_APP_SECRET" not in env
  10. assert ("OPENROUTER_API_KEY" in env) != ("OPENAI_API_KEY" in env)