Skip to content

Feat/rate limit redis backend 429 UI - #461

Open
kuse-design wants to merge 2 commits into
ToluLabs:mainfrom
kuse-design:feat/rate-limit-redis-backend-429-ui
Open

Feat/rate limit redis backend 429 UI#461
kuse-design wants to merge 2 commits into
ToluLabs:mainfrom
kuse-design:feat/rate-limit-redis-backend-429-ui

Conversation

@kuse-design

Copy link
Copy Markdown

What does this PR do?

Closes #

Type of change

  • Bug fix
  • New feature / credential type
  • Refactor / cleanup
  • Docs
  • CI / tooling

Merge requirements

  • CI is greencargo test (contracts), pnpm tsc --noEmit (frontend), pnpm build (frontend), circuit tests — all green
  • Greptile confidence ≥ 4/5 — all review comments addressed, no unresolved threads
  • Circuit changes: fixtures/<type>/ artifacts updated
  • No NEXT_PUBLIC_ prefix on server-only env vars
  • No identity fields stored or logged after KYC provider call
  • prehash:false preserved on any issuer signing path touched
  • Issuer private key never referenced from client-bundled code

✅ Merge requirements

  • All CI checks pass (contracts / frontend / circuits as applicable)
  • Every Greptile review comment is addressed — no unresolved review threads
  • Greptile confidence score is 4/5 or higher

closes #70

kuse-design and others added 2 commits August 31, 2026 07:33
Add an IssuerSigner interface in frontend/lib/signer.ts with two
implementations:
- EnvSigner: signs with a local secp256k1 private key (dev/mock only)
- KmsSigner: delegates to AWS KMS via Sign(KeyId, Digest) — the raw
  private key never enters the Node.js process

Selected via ISSUER_SIGNER=env|kms env var (defaults to env for local
dev). KMS returns a DER signature which is converted to the raw (r,s)
64-byte form Noir expects. prehash: false semantics are preserved via
KMS MessageType=DIGEST.

The @stellarcred/issuer IssuerClient now accepts an IssuerSigner
option alongside the legacy privateKey path, so existing code keeps
working unchanged.

Security notes documented in SECURITY.md.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
… limiting

- Add RATELIMIT_BACKEND env var (memory|redis) for selecting rate-limit
  backend. Memory works with no external dependency for local dev; Redis
  (Upstash) enables shared counters for serverless/multi-replica deploys.
- Add separate wallet window (RATE_LIMIT_ISSUE_WALLET_WINDOW_SECONDS,
  default 3600s = 1 hour) vs IP window (default 60s = 1 minute) so the
  per-wallet limit has a longer horizon as intended.
- Frontend /verify page now detects 429 responses and shows a friendly
  "try again in N seconds" message instead of a generic error.
- Add tests for LIMITS.walletWindowMs, LIMITS.backend(), and 429 handling
  in the verify flow.
- Document RATELIMIT_BACKEND, RATE_LIMIT_REDIS_URL, and
  RATE_LIMIT_ISSUE_WALLET_WINDOW_SECONDS in .env.example.
- pnpm tsc --noEmit and pnpm build both pass.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@kuse-design Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Rate limiting and abuse protection on the /api/issue endpoint

1 participant