Comprehensive guides and references for the OpenFrame platform
The Gateway Rest Controllers module exposes REST endpoints at the API Gateway layer for tool integrations and internal authorization probing. It acts as a thin, reactive HTTP façade that:
This module is part of the Gateway Service and works closely with:
All controllers are implemented using Spring WebFlux and return Mono<ResponseEntity<...>>, ensuring fully non-blocking, reactive request handling.
At runtime, the Gateway Rest Controllers sit at the edge of the platform and delegate most business logic to services in the gateway core.
flowchart LR
Client["Client / Frontend"] -->|"HTTPS"| Gateway["Gateway Rest Controllers"]
Gateway -->|"Delegates"| IntegrationService["Integration Service"]
Gateway -->|"Delegates"| RestProxyService["Rest Proxy Service"]
IntegrationService -->|"Calls"| ExternalTool["External Tool API"]
RestProxyService -->|"Proxies"| ExternalTool
Gateway -->|"Secured by"| SecurityLayer["Gateway Security Config"]
Mono-based endpoints)toolIdThis module contains two primary controllers:
IntegrationController exposes all REST endpoints under the /tools base path and is responsible for:
It depends on:
IntegrationService – for validating or testing tool integrationsRestProxyService – for forwarding arbitrary HTTP requests to external tool backendsBase path: /tools/{toolId}
GET /{toolId}/healthPOST /{toolId}/testBoth endpoints:
integrationService.testIntegrationConnection(toolId)200 OK with response body on success400 Bad Request with error message on failureflowchart TD
Request["HTTP Request"] --> Controller["IntegrationController"]
Controller -->|"Call"| Service["IntegrationService.testIntegrationConnection"]
Service -->|"Mono<String>"| Controller
Controller -->|"map(ResponseEntity.ok)"| Success["200 OK"]
Service -->|"Error"| ErrorPath["onErrorResume"]
ErrorPath --> BadRequest["400 Bad Request"]
The use of onErrorResume ensures controlled error handling and consistent HTTP responses.
Mapping:
/{toolId}/**GET, POST, PUT, PATCH, DELETE, OPTIONSThis endpoint:
ServerHttpRequestrestProxyService.proxyApiRequest(toolId, request, body)It acts as a generic reverse proxy for tool APIs.
flowchart TD
ClientReq["Client Request /tools/{toolId}/..."] --> Controller
Controller["IntegrationController"] --> ProxyService["RestProxyService.proxyApiRequest"]
ProxyService --> ExternalAPI["External Tool API"]
ExternalAPI --> ProxyService
ProxyService --> Controller
Controller --> Response["ResponseEntity<String>"]
This design allows the gateway to:
without modifying downstream tool APIs.
Mapping:
/agent/{toolId}/**GET, POST, PUT, PATCH, DELETE, OPTIONSThis endpoint is similar to the general proxy endpoint but explicitly scoped for agent communication.
It delegates to:
restProxyService.proxyAgentRequest(toolId, request, body)This separation enables different routing rules, authentication mechanisms, or header transformations for agent traffic.
Although no explicit security annotations are defined inside the controller, it relies on upstream configuration:
The Authentication parameter in health and test endpoints ensures:
Security enforcement occurs before controller invocation.
The InternalAuthProbeController exposes a minimal internal endpoint used for authorization probing.
Base path:
/internal/authzEndpoint:
GET /internal/authz/probeReturns:
200 OKMono<Void>)This controller is only enabled when the property below is set:
openframe.gateway.internal.enable=true
It uses @ConditionalOnProperty to ensure the endpoint is not exposed unless explicitly configured.
flowchart TD
ProbeRequest["GET /internal/authz/probe"] --> Controller["InternalAuthProbeController"]
Controller --> ReturnEmpty["Mono.empty()"]
ReturnEmpty --> Ok["200 OK"]
This endpoint contains no business logic and serves purely as a lightweight liveness/auth validation probe.
Both controllers follow these principles:
This ensures the gateway remains scalable under high concurrency, especially when proxying high-volume tool and agent traffic.
| Component | Responsibility |
|---|---|
| IntegrationController | Tool health checks, integration tests, API proxying |
| InternalAuthProbeController | Internal authorization probe endpoint |
| IntegrationService | Integration connectivity validation |
| RestProxyService | HTTP request forwarding and response handling |
Within the OpenFrame platform architecture:
This modular separation ensures:
The Gateway Rest Controllers module is a focused, reactive gateway layer responsible for:
It plays a critical role in securely bridging external integrations and agents with the OpenFrame platform, while keeping the gateway lightweight, reactive, and extensible.