Some checks failed
ci / cargo test (abacus) (push) Has been cancelled
ci / cargo test (agent-runtime) (push) Has been cancelled
ci / cargo test (context-passport) (push) Has been cancelled
ci / cargo test (game-economy) (push) Has been cancelled
ci / cargo test (ledgerline) (push) Has been cancelled
ci / cargo test (mint) (push) Has been cancelled
ci / cargo test (rago) (push) Has been cancelled
ci / cargo test (relay) (push) Has been cancelled
ci / cargo test (toolgate) (push) Has been cancelled
ci / cargo test (turnstile) (push) Has been cancelled
ci / cargo test (vend) (push) Has been cancelled
ci / node suites (push) Has been cancelled
- New service apps/rithub-device-auth (pm2, 127.0.0.1:3357, proxied at rithub.dev /device* and /api/rit/device*): RFC-8628-shaped device authorization flow (POST /api/rit/device/code, GET /device, POST /api/rit/device/token) wrapping the forge core's own real OAuth2 "Rit CLI" application via PKCE (no client secret). Only a SHA-256 hash of each device_code is stored, codes expire in 10 minutes and are single-use, polling is rate-limited. The /device confirmation page reuses the real site chrome and shows the exact scopes being granted. - Extended the engine's own "Rit CLI" OAuth2 app with a second redirect_uri for the new callback, and bumped [oauth2] ACCESS_TOKEN_EXPIRATION_TIME to 30 days (was the 1h default) so a `rit login` session behaves like a normal long-lived token. - packages/rithub-cli: `rit login` on a TTY now runs the real device flow by default (src/deviceLogin.mjs); `--paste-token` keeps the old paste-a-PAT fallback. Fixed two real bugs found while verifying this: apiCallRaw() never merged a caller's extra headers (broke `rit api` with --method/--input, e.g. the Content-Type needed to PATCH the OAuth2 app above), and issue close/reopen only accepted HTTP 200 when this engine build answers 201. Bumped 0.3.0 -> 0.3.1, published to npm. - Full-scope admin token minted for caelum0x (RITHUB_CAELUM0X_FULL_TOKEN in products/.env) and the previously-403ing commands (issue, label, milestone, status, change comment, org) re-verified live against a throwaway repo, then deleted. - End-to-end proved live: a mail.tm test account signed in through the real /device page in a real browser session, `rit login` in a fresh HOME completed, `rit whoami`/`rit issue create`/`rit clone` all worked off the resulting token. Test repo, issue, and account deleted after. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
27 lines
962 B
JavaScript
27 lines
962 B
JavaScript
// pm2 process definition for Rithub's device-code sign-in service
|
|
// (RIT-ACT, 2026-12-01). Bound to 127.0.0.1 only -- public exposure is via
|
|
// Caddy's /device* and /api/rit/device/* handle blocks on rithub.dev (see
|
|
// /etc/caddy/sites-enabled/rithub-dev.caddy), same pattern already used
|
|
// for /protect*, /billing*, /mcp*.
|
|
module.exports = {
|
|
apps: [
|
|
{
|
|
name: "rithub-device-auth",
|
|
cwd: __dirname,
|
|
script: "bin/start.mjs",
|
|
env: {
|
|
NODE_ENV: "production",
|
|
PORT: "3357",
|
|
RITHUB_BASE_URL: "https://rithub.dev",
|
|
// Client ID of the engine's own real OAuth2 "Rit CLI" application
|
|
// (non-confidential/public client, PKCE -- no secret needed or
|
|
// stored here). Registered 2026-11-18, confirmed live 2026-12-01.
|
|
RITHUB_DEVICE_OAUTH_CLIENT_ID: "a7e89e94-f193-4c2a-b24c-3f5322e639b0",
|
|
},
|
|
autorestart: true,
|
|
max_restarts: 10,
|
|
min_uptime: "10s",
|
|
},
|
|
],
|
|
};
|