Repository navigation
Add the OrcaRouter Cyber Inference provider (API key + OAuth 2.0 PKCE) to the veil proxy - #3
Open
flenordchere264-crypto wants to merge 1 commit into
Conversation
…) to the veil proxy Signed-off-by: flenordchere264-crypto <flenordchere264-crypto@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a first-class OrcaRouter Cyber Inference provider to veil, the local proxy that coding agents (Claude Code, OpenAI-compatible clients) talk to. OrcaRouter is an OpenAI-compatible AI gateway that routes many providers behind one endpoint. It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every prompt/response and governing every tool call on a default-deny basis, with no application code changes.
What's new
prototype/veil/orcarouter.py: a dedicated provider module (idorcarouter, nameOrcaRouter Cyber Inference) with its own credential store, kept independent of every other provider in veil.veil provider orcarouter api-keyaccepts ansk-orca-…key from the prompt or fromORCA_KEY; the key is format-checked, stored under a private credentials file inVEIL_HOME, and never printed.veil provider orcarouter pkceruns an authorization-code flow with S256 only —statepluscode_challenge, checked with a constant-time comparison on the loopback callback (flow A), plus an out-of-band code-paste flow for headless boxes (flow B). Authorize starts athttps://www.orcarouter.ai/auth; the code is exchanged atPOST https://www.orcarouter.ai/api/v1/auth/keyson the web origin, never on the API origin. The resulting key is durable (no refresh token), exactly one key per login, and a401marks that credential generation as needing re-auth (veil provider orcarouter status).ORCA_BASE_URL,ORCA_AUTH_BASE_URL,ORCA_API_BASE_URL; HTTPS is required except on loopback.veil provider orcarouter modelsreadsGET https://api.orcarouter.ai/v1/modelsand builds capability-filtered selectors (text, multimodal via--capability multimodal --modality image, tools, etc.).orcarouter/auto; cyber work defaults toorcacyber-ultra-1.0/orcacyber-zero-1.5; the fallback isorcarouter/fusion.veil proxy --provider orcarouter --auth api-key|pkceinjects the stored credential for both the Anthropic Messages and OpenAI Chat Completions wire formats and forwards to the API root (no doubled/v1);veil adoptcan point a Claude Code settings file at the local proxy with the OrcaRouter model. Docs inREADME.md.Tests
prototype/tests/test_orcarouter.pycovers provider config, API key connect (including the env-only path that never echoes the key), PKCE S256/state handling for both flows, catalog parsing and capability/capability-modality filters, auth errors and 401 → re-auth, proxy credential injection for both wire formats, and regression tests for the/v1forwarding and model selection. An opt-in live test (test_live_orcarouter_gateway_end_to_end, skipped unlessORCAROUTER_API_KEYis set) goes through the real proxy handler to the live gateway. Offline: 28 passed, 1 skipped; with the key: 29 passed.Docs and model tiers: https://www.orcarouter.ai/cyber and https://www.orcarouter.ai/models?tier=cyber.
I'm an engineer on the OrcaRouter team.