Files
orangecat/scripts/oauth
Georgy ButaevandClaude Opus 4.8 cc4d40cdb0 feat(oauth): scripted, idempotent OIDC client registration
The FleetCrown oauth_clients row was previously inserted ad-hoc with no
committed tooling. Add scripts/oauth/register-client.ts as the SSOT for it:

- owner-gated (ORANGECAT_OWNER_SEED=1), runs against the self-hosted DB via
  the service-role admin client;
- idempotent upsert by client_id — refreshes non-secret fields every run so
  config drift is corrected, leaves the secret untouched unless --rotate;
- least-privilege FleetCrown spec (1 redirect, 7 scopes) validated against the
  OAuth scope registry SSOT (parseAndValidateScopes); FLEETCROWN_REDIRECT_URIS
  appends dev/preview origins;
- prints the plaintext secret once on creation/rotation for out-of-band handoff.

Mirrors the integration_keys hash+revocation model and the seed-script
convention (seed-revive-my-old-ride.ts).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 12:37:38 +02:00
..