Skip to content

feat(onramp): signed-JWT gate #2549

Open

Description

@thiras

The onramp's gate is pluggable since decdn/sponsord#19 (sponsord_onramp::gate::Gate), with Turnstile as the only built-in. A webhook needs the publisher's backend online for every download; a signed token doesn't.

Proposal

ONRAMP_GATE=jwt: the publisher's site mints a short-lived JWT for a user, and the gate page posts it as proof.

  • Verification keys: ONRAMP_JWT_SECRET[_FILE] (HS256) or ONRAMP_JWT_PUBLIC_KEY / a JWKS URL (ES256/EdDSA).
  • Required claims: exp (short, e.g. ≤ 10 min), aud = the onramp's public URL, and sub = the download key's address (client), so a token can't be replayed for another key. Optionally jti with an in-memory seen-set until exp.
  • The default page for this gate reads the token from the URL fragment (/fund?client=..#token=..), so the publisher can link users straight to it.

Done when

  • JwtGate implements Gate, with tests: valid, expired, wrong audience, wrong sub, bad signature, replay.
  • Docs cover minting a token on the publisher side.

Activity

  1. added
    kind:feature
    on Oct 3, 2026
  2. transferred this issue fromdecdn/sponsordon Oct 19, 2026
  3. added
    area:sponsord
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:sponsordkind:feature

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions