ZeroClick::Sellers.create, or set on config.zeroclick under Rails.
Options
Signing secrets
kid, and both must verify. Remove the old entry only once no traffic carries it.
If your secrets live in a vault rather than the environment, pass a resolver instead:
signing_secrets or resolve_signing_secret — giving both, or neither, raises at construction rather than at the first request.
Split usage keys
Useful when a separate process reports usage — a Sidekiq worker settling variable work, say. The reporting process then needs no read scope, and the serving process needs no write scope.The allowance-unavailable policy
When the allowance API cannot give an answer — a timeout, a 5xx, an unparseable body — this decides what happens.
A recognised
allowed: false is always a 402, never an outage — the API answered, and the answer was no.
An Allow reached through the policy reports allowance == "unavailable" rather than "allowed", so you can distinguish served-because-we-could-not-check from served-because-they-paid:
Timeouts
check_timeout_seconds bounds the allowance check, which sits in your request path — it applies to connect, read and write. The default of 1.5 seconds trades a slow check for a fast fail-open. Raise it only if your outage policy is "deny" and you would rather wait than refuse.
Body size
The middleware buffers the request body to verify it, bounded at 10 MiB by default:413.