API Gateway Integration 🏗️
Leveraging Architectural Simplicity
While our API is designed for direct, seamless integration, placing it behind an API Gateway (or a dedicated proxy layer) unlocks significant architectural and performance benefits. This approach ensures your production environment benefits from caching, centralized security, and compliance enforcement without requiring a dedicated runtime or complex service mesh setup just to manage TPP validation.
The Gateway acts as the control plane, allowing your backend services to remain clean and focused on their core business logic.
1. ⚡️ Performance & Efficiency: Bypassing Dedicated Runtimes
The primary architectural advantage is the ability to leverage your Gateway's built-in features to eliminate repeated external calls.
Zero Integration Runtime: Your upstream application code simply makes a call to your internal Gateway endpoint. The Gateway handles the heavy lifting of external communication, protocol negotiation, and response manipulation—freeing your application servers from this non-core logic.
Intelligent Caching: TPP status changes infrequently. The Gateway can cache the successful
200 OKvalidation responses, keying them off the eIDAS certificate hash. This drastically reduces latency for subsequent calls and saves costs on external requests.Cache Expiry Logic: By reading our
x-tpp-latestheader (the time of the last NCA/EBA register update), the Gateway can implement a time-bound cache, ensuring data is refreshed when it's most likely to have changed.
2. 🛡️ Centralized Security and Compliance Enforcement
The API Gateway is the ideal place to enforce the PSD2 compliance rules embedded within our API response headers.
Gateway Action | Source Data | Benefit |
|---|---|---|
Request Validation |
| Ensures the TPP is requesting services for jurisdictions that were included in the validation call. |
Passporting Enforcement |
| Crucial PSD2 compliance check. The Gateway automatically compares requested jurisdictions ( |
Audit Logging | All headers ( | Logs all structured compliance data before the request hits your backend. Provides a single, auditable record for every transaction. |
Error Standardization |
| Converts external |
3. Integration Example: Passporting Enforcement Logic
The most critical Gateway function is the Passporting Enforcement Check. This ensures regulatory compliance by matching the TPP's requested jurisdictions against the confirmed licenses.
This logic runs after a successful 200 OK validation response is received.
Apigee JavaScript Policy: Verifying Requested Jurisdictions
This example uses JavaScript, a common scripting language within Gateways (like Apigee, Kong, etc.), to check if every requested jurisdiction (request.queryparam.cc) is present in the confirmed passporting list (tpp.passports).
Apigee RaiseFault Policy: Denial of Access
If the check fails, the Gateway raises a fault, immediately denying the request before it reaches your core backend service.
This setup ensures that:
The external validation service confirms the certificate is valid and registered.
The API Gateway then performs the compliance check to ensure the scope of the request (
cc) is within the TPP's confirmed rights (x-tpp-passports), granting or denying access based on the match.
.see also
