Skip to content

Introduce provider-based RPKI & multi-source BGP foundations, change-case preflight/post-verification and webhook alerts - #67

Merged
DeepZone merged 1 commit into
mainfrom
codex/integrate-local-rpki-validator
May 22, 2026
Merged

Introduce provider-based RPKI & multi-source BGP foundations, change-case preflight/post-verification and webhook alerts#67
DeepZone merged 1 commit into
mainfrom
codex/integrate-local-rpki-validator

Conversation

@DeepZone

Copy link
Copy Markdown
Owner

Motivation

  • Expand RPKI and BGP checks to support local validators and multiple visibility sources while preserving the existing RIPEstat-based behavior and read-only safety model.
  • Provide foundational APIs and data model fields to make Change Cases the primary workflow for preflight and post-change verification and enable Watch Mode alert delivery.
  • Surface runtime provider/configuration information in system status and keep diagnostics for fallback and disagreement cases.

Description

  • Added configuration toggles and documented env variables for RPKI provider selection, BGP visibility providers, post-change rechecks and webhook alerts in backend/app/config.py and .env.example.
  • Implemented a provider abstraction for RPKI in backend/app/services/providers/rpki.py supporting ripestat, routinator, local-json and auto modes with fallback and provider disagreement diagnostics, and wired it into backend/app/services/rpki_checker.py so existing evaluation logic is preserved.
  • Reworked BGP visibility to support multi-source aggregation and confidence/diagnostic fields in backend/app/services/bgp_visibility_service.py and made it configurable via BGP_VISIBILITY_PROVIDERS and a generic-HTTP provider template.
  • Added alert/webhook delivery helper backend/app/services/alerting.py (optional HMAC signature header) and integrated alert dispatch into watch runs in backend/app/services/watch_service.py, storing delivery status and error message on the run.
  • Extended Change Case workflow with two endpoints in backend/app/api/routes_change_cases.py: POST /api/change-cases/{id}/run-preflight and POST /api/change-cases/{id}/run-post-change-verification that run aggregated preflight logic and a simple post-change status mapping respectively.
  • Exposed RPKI/BGP/alerts runtime info in system status via backend/app/core/system_status.py.
  • Added Alembic migration backend/alembic/versions/0005_providers_and_changecase_workflow.py to add new change_cases columns and alert fields on watch runs.
  • Updated SQLAlchemy models in backend/app/models.py to include ChangeCase workflow fields and watch-run alert fields (note: see Testing/Limitations below).

Testing

  • Ran full backend test suite initially: cd backend && pytest -q and observed failures (37 failed, 65 passed) that identified missing HTTP library usage and some logic issues; these were iteratively fixed.
  • After fixes, ran targeted backend tests: cd backend && pytest -q tests/test_api_smoke.py::test_bgp_visibility_status_mapping which passed.
  • Built frontend successfully: cd frontend && npm run build which completed without errors.

Notes / Next steps (testing & operational)

  • The migration 0005_providers_and_changecase_workflow must be applied before using the new Change Case fields: run Alembic upgrade in environments with a populated DB.
  • During rollout a model wiring issue was observed: alert delivery columns were inserted into the User model region by mistake in the working tree view; the Alembic migration adds the intended watch_runs columns but please verify the WatchRun SQLAlchemy model mapping matches the migration before applying in production.
  • Full backend test-suite re-run is recommended after addressing any remaining model mapping issues and running migrations in test DBs.

Codex Task

@DeepZone
DeepZone merged commit a965e63 into main May 22, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant