Proposal: API-first management for OmniRoute — management-scoped API keys & settings endpoints #1567
Replies: 5 comments 1 reply
|
Hey @shannonlowder! |
RFC: Management‑Scoped API Tokens for OmniRouteAuthor: Shannon 1. SummaryThis RFC proposes adding management‑scoped API tokens to OmniRoute, enabling programmatic access to existing management routes using a simple, coarse‑grained permission model:
Tokens authenticate via: The goal is to unlock automation workflows (CI/CD, agent orchestration, infrastructure provisioning) while keeping the initial implementation small, safe, and maintainable. 2. MotivationOmniRoute currently exposes management functionality only through:
This limits automation for:
A minimal management API with scoped tokens enables these workflows without expanding the attack surface or requiring new endpoints. 3. Goals3.1. Primary Goals (MVP)
3.2. Non‑Goals (for future RFCs)
4. Design Overview4.1. Data Model (JSON‑backed)Add a new top‑level key in {
"managementTokens": [
{
"id": "cuid",
"name": "ci-cd",
"scope": "admin",
"hash": "<hashed-secret>",
"createdAt": "2026-04-24T00:00:00Z",
"lastUsedAt": null,
"revokedAt": null
}
]
}This mirrors how providers, combos, and settings are already stored. 4.2. Token Generation-User creates a token via dashboard or API
Token format example: 4.3. Authentication FlowExtend verifyAuth():
4.4. Scope Enforcement
Applied uniformly across existing management routes:
4.5. Token CRUD EndpointsNew endpoints under /api/management/tokens: 5. Security Considerations
6. Backward Compatibility
7. Future Extensions (not part of MVP)
8. Implementation PlanPhase 1: RFC Review
Phase 2: PR Implementation
Phase 3: Documentation
9. Open Questions
10. ConclusionThis RFC proposes a minimal, maintainable foundation for programmatic management of OmniRoute. It aligns with the maintainers’ guidance (coarse scopes, Bearer tokens, reuse of existing routes) while enabling real‑world automation and orchestration use cases. Feedback welcome — happy to adjust the scope or implementation details based on maintainer input. |
|
I hope this message finds you well. I noticed that issue 1605 I raised has been closed with the note that the API-first management feature is being tracked internally for a future release. I’ve completed the code changes for this feature and am finalizing unit test coverage, along with a few integration tests to ensure we can use the API effectively. Given the internal tracking, I’m uncertain about the timeline for this feature’s release. I would love to contribute to the community by adding this feature without forking the repository. Could you please share your thoughts on how we might move this feature forward? I appreciate any guidance you can provide! Thank you for your time! |
|
Hi @shannonlowder What's already available today: What this proposal adds:
|
Uh oh!
There was an error while loading. Please reload this page.
Summary
Current behaviour:
OMNIROUTE_TOKEN(public API key) authenticates/api/v1/*proxy endpoints, while dashboard management endpoints (e.g./api/pricing,/api/settings/*) require a dashboard session JWT cookie or server-signed session token. This prevents programmatic management of settings (model pricing, providers, combos, etc.).Proposal
Add a management API (or extend existing management routes) to support programmatic admin actions with scoped, auditable tokens so anything doable in the UI is automatable.
Key design questions for maintainers
/api/*management routes,/api/management/*namespace, orSecurity must-haves
backupDbFile("pre-write")is already used).Implementation outline (high level)
management_tokenstable:id, secret_hash, scopes, name, created_by, revoked_at.verifyAuth()to accept management Bearer tokens and validate scopes for routes./api/pricing) with tests and docs.Offer
I can sponsor/contract implementation. If maintainers want this, I can prepare an RFC/PR (token schema, scope list, and a pilot PR for pricing).
Next steps / Questions
Suggested labels: idea, api, security, help-wanted
All reactions