Skip to content

Persist Markee authorization nonces for production #953

Description

@Corantin

Goal

Replace the in-memory Markee opt-in and revenue-claim authorization challenge maps with a shared, atomic, single-use nonce store suitable for production serverless deployments.

Scope

  • Persist challenges for /api/markee/authorize and /api/markee/claim/authorize.
  • Preserve the five-minute TTL and consume-before-verification replay protection.
  • Make nonce consumption atomic across instances.
  • Re-enable challenge issuance in production only after the durable store is configured.
  • Add multi-instance/replay and expiry tests.
  • Document and provision the required Vercel environment variables.

Current behavior

Both endpoints intentionally fail closed in production because an in-memory Map cannot prevent replay across cold starts or concurrent serverless instances.

Tracked from PR #951 review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions