feat(auth): added auth-gateway forward-proxy and broker usage/migrate endpoints

- Added `omp auth-gateway serve/token/status` — a forward-proxy injecting broker credentials for OpenAI Chat, Anthropic Messages, and OpenAI Responses wire formats.
- Added `GET /v1/usage` to auth-broker and auth-gateway; usage cache switched to 5-min per-credential TTL with jitter and last-good fallback on failure.
- Added `AuthStorage.setConfigApiKey/removeConfigApiKey/clearConfigApiKeys` so `models.yml` `apiKey` beats OAuth tokens without overriding `--api-key`.
- Added `omp auth-broker migrate --from-local` for idempotent upload of local SQLite/env credentials to the broker.
This commit is contained in:
can1357
2026-05-16 23:24:33 +02:00
parent d1877baf66
commit df1c1a6ba8
54 changed files with 6802 additions and 227 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ const SEPARATORS = ["~", "%", "÷", ">", ":"] as const;
const MODELS = [
"openrouter/z-ai/glm-4.7:nitro",
"openai/gpt-5.4-nano",
"p-anthropic/claude-sonnet-4-6",
"anthropic/claude-sonnet-4-6",
] as const;
const CONCURRENCY = 3;
+1 -2
View File
@@ -205,8 +205,7 @@ function fmtNum(value: number): string {
}
function shortModel(model: string): string {
const cleaned = model.replace(/^p-anthropic\//, "anthropic/");
const segs = cleaned.split("/");
const segs = model.split("/");
return segs[segs.length - 1].replace(/:nitro/, "");
}