Skip to content

Validate public API requests before registry access#1859

Open
vultuk wants to merge 2 commits into
orchestration-agent:mainfrom
vultuk:bounty-1857-api-validation-codes
Open

Validate public API requests before registry access#1859
vultuk wants to merge 2 commits into
orchestration-agent:mainfrom
vultuk:bounty-1857-api-validation-codes

Conversation

@vultuk
Copy link
Copy Markdown

@vultuk vultuk commented May 22, 2026

Summary

  • move agent API validation into a shared service layer before registry lookup or mutation
  • return deterministic 400 responses for malformed status filters and malformed agent IDs
  • keep unauthorized requests short-circuited before service/registry access and restore the static /agents/count route ahead of the dynamic ID route
  • include current-main suite-health fixes for AgentStatus export and metrics timer lock re-entry so the full suite can run cleanly

Validation

  • uv run pytest tests/test_api_validation.py -q -> 6 passed
  • uv run pytest tests/test_api_validation.py tests/test_metrics.py tests/test_scheduler.py -q -> 15 passed
  • uv run pytest -q -> 28 passed
  • uv run flake8 src/api/agent_service.py src/api/routes.py src/agent/__init__.py src/common/metrics.py tests/test_api_validation.py -> passed
  • python3 -m py_compile src/api/agent_service.py src/api/routes.py src/agent/__init__.py src/common/metrics.py tests/test_api_validation.py -> passed
  • git diff --check -> passed
  • Star gate verified: viewerHasStarred=true

Fixes #1857

BTC payout wallet: bc1qa5acxqc3wldzxwjhe8a65gjp6n7dxmafm6qs4j

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ Bounty $5k ] [ API ] Use consistent error codes for validation failures — public API clients

1 participant