Files
OmniRoute/tests
diegosouzapw 78c4ef33ee feat(cli): remote mode — drive a remote OmniRoute with scoped access tokens
`omniroute connect <host>` logs in (management password → scoped access token,
or paste one with --key) and saves it as the active context, so every CLI
command then targets that remote server. One CLI, local or remote.

Access tokens (oma_):
- new cli_access_tokens table + src/lib/db/accessTokens.ts (sha-256 hashed,
  plaintext shown once, prefix, revoke by id/prefix, expiry, last_used)
- 3-level scopes read ⊂ write ⊂ admin (src/lib/accessTokens/scopes.ts)

Enforcement:
- shared evaluateAccessTokenAuth used by BOTH the central managementPolicy
  (proxy.ts gate) and requireManagementAuth — no drift
- required scope inferred from HTTP method + admin allowlist (accessScopes.ts)
- loopback-only routes stay unreachable by remote tokens (hard rules #15/#17)

Endpoints: POST /api/cli/connect (public, password+lockout), GET /api/cli/whoami,
GET/POST /api/cli/tokens, DELETE /api/cli/tokens/:id.

CLI: connect, tokens create/list/revoke/scopes, configure <cli> (interactive
provider+model → local profile from the remote catalog); unified context
resolution now reads baseUrl AND accessToken from the active context.

Dashboard: Settings → Access Tokens (create / copy-once / revoke).
Docs: docs/guides/REMOTE-MODE.md, README section + index, openapi entries.
Tests: 63 unit/integration (scopes, token store, inference, auth gate, helpers).
2026-06-19 02:31:33 -03:00
..
2026-06-17 19:26:32 -03:00
2026-05-23 01:46:59 -03:00
2026-06-17 19:26:32 -03:00
2026-06-10 13:49:08 -03:00
2026-06-13 17:27:40 -03:00