Skip to content

Federator Service as a REST API Gateway #183

Description


Summary: Federator service as a REST API Gateway

Type: Story
Component: Federator
Labels: federation, api-gateway, routing, m2m


Description

The Federator must be extended to act as a REST API Gateway, providing a unified entry point for inter-organisational data exchange requests across the federation. Rather than point-to-point connections between nodes, consuming nodes route outbound requests through the Federator, which handles mTLS termination, request authentication, routing to the correct target node, and response relay. This centralises cross-cutting concerns (security, redaction, audit) at the gateway layer.


Acceptance Criteria

  • Federator accepts inbound REST requests from local services and routes them to the correct target node based on a configurable routing table
  • All outbound connections to target nodes are established over mTLS using the node's role-scoped certificates
  • Inbound requests are authenticated before routing — unauthenticated requests are rejected with 401
  • Routing table maps request path or destination identifier to target node endpoint; configuration is externally managed and hot-reloadable
  • Federator relays the target node's response back to the caller, preserving HTTP status codes
  • Requests and responses pass through the redaction pipeline prior to relay
  • Each routed request produces an audit log entry: source, destination node identity, path, timestamp, and status
  • Target node unavailability returns a structured error to the caller — Federator does not hang indefinitely (configurable timeout)

Technical Notes

  • Spring Boot with Spring Cloud Gateway or a lightweight WebClient-based proxy is suitable; evaluate Spring Cloud Gateway for built-in filter chain support (aligns with redaction and audit interceptor pattern)
  • mTLS outbound connections must use role-scoped producer/consumer certificates from the shared volume (aligns with multi-cert story)
  • Routing table: file-backed or Management Node-sourced; externalise as federator.gateway.routes; hot-reload via WatchService consistent with cert reload pattern
  • Request timeout: federator.gateway.timeout-ms, default recommended 30s
  • Redaction pipeline (from data redaction story) must be inserted as a gateway filter on the outbound path

Out of Scope

  • Rate limiting and throttling (subsequent story)
  • Service discovery (routing table is statically configured in this iteration)
  • Human operator traffic

Dependencies

  • Role-scoped producer/consumer certificates available on shared volume
  • Data redaction pipeline implemented and filter-insertable
  • Target nodes expose REST endpoints compatible with gateway relay

Definition of Done

  • Request routed end-to-end over mTLS and response relayed correctly
  • Unauthenticated request rejection verified
  • Routing table hot-reload confirmed without restart
  • Redaction pipeline applied on gateway path verified
  • Timeout and unavailability behaviour confirmed
  • PR reviewed and merged

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions