Skip to content

feat(license): Ed25519 asymmetric license minting, Dodo webhooks & RFC 8628 device flow - #40

Merged
divyanshujethi merged 1 commit into
mainfrom
feat/phase1-licensing-and-device-flow
Nov 17, 2026
Merged

divyanshujethi merged 1 commit into
mainfrom
feat/phase1-licensing-and-device-flow

Conversation

@divyanshujethi

Copy link
Copy Markdown
Contributor

Phase 1: Unified Licensing, Dodo Webhooks & /device RFC 8628 Flow

Summary of Changes:

  1. Asymmetric Ed25519 License Engine (src/lib/license-engine.js):

    • Implements RFC 8037 (EdDSA / Ed25519) JSON Web Token (JWT) minting with authoritative root keys.
    • Zero-egress offline verification for client CLIs and IDEs.
    • Tier entitlement matrix (free, starter, pro, team, enterprise) and JWKS endpoint.
  2. RFC 8628 Device Authorization Grant Store (src/lib/device-store.js):

    • Generates high-entropy device_code and unambiguous 20-character base-20 user_code (XXXX-YYYY).
    • Session state tracking (pending, approved, denied, expired).
  3. Dodo Payments Automated Minting & Fulfillment (src/lib/dodo-webhook.js):

    • Standard Webhook HMAC-SHA256 signature verification.
    • Automatic license JWT generation on verified payment.succeeded.
    • Auto-approval of pending device session when user_code is provided in payment metadata.
  4. Cloudflare Functions & Next.js Endpoints:

    • /api/device/code & /api/device/token & /api/device/approve
    • /api/v1/license/public-key & /api/v1/license/verify
    • /api/webhooks/dodo
  5. Interactive Workstation Approval UI (/device):

    • Seamless browser approval with auto-filling user_code from query param.
  6. Unified CLI (bin/ritualdev.js):

    • Added ritualdev login, ritualdev status, ritualdev verify <token>, ritualdev logout.
  7. Automated Test Suite (tests/license-and-device-flow.test.mjs):

    • 26/26 passing tests across unit and integration suites.

… 8628 device flow

- Add RFC 8037 Ed25519 license minting and zero-egress offline verification in src/lib/license-engine.js
- Implement RFC 8628 OAuth 2.0 Device Authorization session store in src/lib/device-store.js
- Automate Dodo Payments webhook handling in /api/webhooks/dodo to mint licenses and auto-approve device sessions
- Add Cloudflare Functions & Next.js endpoints for /api/device/code, /api/device/token, /api/device/approve, and /api/v1/license/public-key
- Add interactive workstation authorization UI at /device
- Add ritualdev unified CLI in bin/ritualdev.js with login, status, verify, and logout
- Add comprehensive 26-test unit & integration test suite in tests/license-and-device-flow.test.mjs
@divyanshujethi
divyanshujethi merged commit 5119b89 into main Nov 17, 2026
1 check passed
@divyanshujethi
divyanshujethi deleted the feat/phase1-licensing-and-device-flow branch November 17, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant