Skip to content

gateway: per-address limits on the wallet API; both APNs environments - #17

Merged
gf5901 merged 1 commit into
mainfrom
gateway-limits
Nov 14, 2026
Merged

gf5901 merged 1 commit into
mainfrom
gateway-limits

Conversation

@gf5901

@gf5901 gf5901 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Follows #16, for v0.1.3. Closes two gaps found preparing Wizard's gateway on staging.

Per-address limits on the wallet API (was under "Not yet")

  • Subscribing and revoking are limited per client address (IPv4 address or IPv6 /64), 60 an hour each by default, so filling the 1,000,000-entry revocation list takes about 17,000 address-hours. Counters hold salted hashes of addresses, in memory only, never logged.
  • trusted_proxies, as in the relay: only those peers' last X-Forwarded-For entry names the client.
  • Serve lz_gateway::app (the router with connect info); main.rs and the tests do.

Both APNs environments

  • "platform": "apns-sandbox", accepted with [apns] allow_sandbox = true, goes to Apple's development environment with the same auth key. One gateway then serves Xcode, TestFlight and App Store builds. Sealed as a new platform code; turning it off later makes those endpoints answer 410.

Config changes are additions with defaults; existing configs behave as before. New tests: sandbox routing, refusing sandbox when not allowed, per-address limits (and that pushes aren't counted), forged and trusted X-Forwarded-For, IPv6 /64.

No server, client, or lz-proto changes: doesn't touch key handling.

🤖 Generated with Claude Code

…PNs environments

Subscribing and revoking are limited per client address (IPv4 address
or IPv6 /64; 60 an hour each by default), so nobody can cheaply fill
the revocation list. The counters hold salted hashes, in memory only.
Behind a proxy, `trusted_proxies` says whose X-Forwarded-For to
believe, as in the relay. Serve `lz_gateway::app`, which carries the
peer address.

`apns-sandbox` subscriptions, accepted with `[apns] allow_sandbox`, go
to Apple's development environment with the same key, so one gateway
serves Xcode, TestFlight and App Store builds. Endpoints seal it as a
new platform code; turning it off later makes them answer 410.

Config changes are additions with defaults: existing configs work as
before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gf5901
gf5901 merged commit 6dd4e95 into main Nov 14, 2026
9 of 10 checks passed
@gf5901
gf5901 deleted the gateway-limits branch November 15, 2026 06:31
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