feat: harden gateway with policy engine, secure tools, and governance docs
This commit is contained in:
@@ -22,13 +22,15 @@ def full_env(monkeypatch):
|
||||
"""Set up complete test environment."""
|
||||
monkeypatch.setenv("GITEA_URL", "https://gitea.example.com")
|
||||
monkeypatch.setenv("GITEA_TOKEN", "test-gitea-token-12345")
|
||||
monkeypatch.setenv("ENVIRONMENT", "test")
|
||||
monkeypatch.setenv("AUTH_ENABLED", "true")
|
||||
monkeypatch.setenv("MCP_API_KEYS", f"{'a' * 64},{'b' * 64}")
|
||||
monkeypatch.setenv("MCP_HOST", "0.0.0.0")
|
||||
monkeypatch.setenv("MCP_HOST", "127.0.0.1")
|
||||
monkeypatch.setenv("MCP_PORT", "8080")
|
||||
monkeypatch.setenv("LOG_LEVEL", "INFO")
|
||||
monkeypatch.setenv("MAX_AUTH_FAILURES", "5")
|
||||
monkeypatch.setenv("AUTH_FAILURE_WINDOW", "300")
|
||||
monkeypatch.setenv("STARTUP_VALIDATE_GITEA", "false")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -153,6 +155,23 @@ def test_all_mcp_tools_discoverable(client):
|
||||
"get_repository_info",
|
||||
"get_file_tree",
|
||||
"get_file_contents",
|
||||
"search_code",
|
||||
"list_commits",
|
||||
"get_commit_diff",
|
||||
"compare_refs",
|
||||
"list_issues",
|
||||
"get_issue",
|
||||
"list_pull_requests",
|
||||
"get_pull_request",
|
||||
"list_labels",
|
||||
"list_tags",
|
||||
"list_releases",
|
||||
"create_issue",
|
||||
"update_issue",
|
||||
"create_issue_comment",
|
||||
"create_pr_comment",
|
||||
"add_labels",
|
||||
"assign_issue",
|
||||
]
|
||||
|
||||
tool_names = [tool["name"] for tool in tools]
|
||||
|
||||
Reference in New Issue
Block a user