Skip to content

TASK: Enforce scope-based authorization at API Gateway #203

Closed
digital-bank-java/api-gateway
#23

Description

@ramioooz

Parent: EPIC: Sprint 4 - Secure Customer Access and Step-Up Authorization

Objective

Enforce scope-based authorization at the API Gateway for admin and internal workflow routes while preserving a cloud-compatible JWT trust configuration.

Scope

  • Add a configurable reactive Spring Security filter chain to API Gateway.
  • Permit only health checks and Auth Service login without a bearer token.
  • Require admin.internal for admin APIs and centralized documentation.
  • Require mfa.internal, transaction.internal, and payment.internal for their corresponding internal workflows.
  • Require authentication for customer/account business APIs.
  • Support local SIT HMAC JWT validation and future OIDC/JWK validation.
  • Return controlled Problem Details responses for 401 and 403.

Acceptance Criteria

  • Unauthenticated admin and internal requests are rejected with 401.
  • Authenticated tokens with an insufficient scope are rejected with 403.
  • Correctly scoped requests reach the downstream route.
  • Health and Auth login remain reachable without a token.
  • The security filter is disabled by default outside explicitly enabled environments.
  • No credentials, signing keys, or tokens are committed.

Related work

This slice adds one focused gateway security integration test; redundant endpoint tests are not required.

Activity

  1. self-assigned this
    on Sep 4, 2026
  2. added theissue type on Sep 4, 2026
  3. ramioooz commented on Sep 4, 2026

    @ramioooz
    MemberAuthor

    Implemented in api-gateway#23, now open for review.

    Scope:

    • JWT bearer validation at the gateway, with local SIT HMAC support and future OIDC/JWK support.
    • admin.internal for /admin/** and centralized documentation.
    • mfa.internal, transaction.internal, and payment.internal for the corresponding workflow routes.
    • Authenticated customer/account APIs; public health endpoints and Auth login.
    • Stable 401/403 Problem Details responses.
    • SIT Helm Secret injection, with security disabled by default outside explicitly enabled environments.

    Related configuration: config-repo#32 adds admin.internal; config-repo#39 enables the gateway flag in SIT. Merge the shared secret/configuration contracts before the gateway rollout; no fixed delay is required, but Config Server must serve the merged revision and the SIT Secret must exist.

    Verification: ./mvnw verify passed with 13 tests and 0 failures; Helm lint and client-side render validation passed. No redundant endpoint-specific tests were added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions