Skip to content

feat: add Redis-backed gateway rate limiting - #21

Merged
ramioooz merged 4 commits into
feature/5-gateway-resilience-v2from
feature/4-redis-rate-limiting
Sep 1, 2026
Merged

ramioooz merged 4 commits into
feature/5-gateway-resilience-v2from
feature/4-redis-rate-limiting

Conversation

@ramioooz

Copy link
Copy Markdown
Member

Summary

  • Add Redis-backed RequestRateLimiter support for public customer and account routes.
  • Use a remote-address key resolver until gateway authentication provides a trusted subject or tenant key.
  • Externalize SIT token-bucket settings through config-repo/api-gateway/api-gateway-sit.yml.
  • Keep health, admin, and documentation routes outside the public rate-limit policy.
  • Bump the gateway image to 0.0.3 and Helm chart to 0.3.0.

Verification

  • ./mvnw --batch-mode clean verify -q
  • helm lint helm --strict
  • helm template api-gateway helm --values helm/values-sit.yaml
  • The focused integration test verifies an allowed request followed by HTTP 429 Too Many Requests.
  • The local Docker Desktop Kubernetes API was unavailable during this run, so SIT rollout remains pending.

Project Tracking

  • Related to api-gateway#4 (Redis-backed rate limiting).
  • The task is parented under the gateway resilience story in Sprint 6.

Related PRs and merge order

  1. Merge infra-sit#23 for the shared Redis service.
  2. Merge api-gateway#20 for the gateway resilience baseline.
  3. Merge config-repo#35 for the gateway resilience configuration.
  4. Merge this PR, after retargeting it to main once api-gateway#20 is merged.
  5. Merge the companion config-repo rate-limit configuration PR.

There is no fixed delay between merges; wait for CI and confirm the prerequisite deployment/configuration is available before the next rollout.

@ramioooz

Copy link
Copy Markdown
Member Author

Follow-up CI fix

  • The Redis Testcontainers integration test runs in the Maven verification job.
  • The Docker image builder now uses ./mvnw --batch-mode clean package -DskipTests, so image packaging does not require a Docker socket or execute integration tests inside the builder.
  • This keeps Maven verification as the test gate while allowing the container build job to package the application.

Verification:

  • DOCKER_HOST=unix:///Users/rami/.docker/run/docker.sock ./mvnw --batch-mode verify
  • 11 tests passed; 0 failures; 0 errors; 0 skipped.
  • Local docker build --tag digital-bank-java/api-gateway:ci . completed successfully.
  • git diff --check passed.

Related project task: api-gateway#4.
Merge dependency: this PR targets the gateway resilience branch and should be integrated after PR #20 is merged and green. No fixed delay is required; wait for the prerequisite CI/deployment state to be healthy.

@ramioooz
ramioooz merged commit 3474d5e into feature/5-gateway-resilience-v2 Sep 1, 2026
3 checks passed
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