Customer API gateway

The Customer API gateway service is the main entry point for REST requests from Parro Nexus partners

The service

All incoming REST calls from Nexus partners go through the Customer API Gateway. The gateway is responsible for calling the correct “inner” services of Nexus to get the message processed. Each Nexus partner get its own instance of this gateway (hence the Customer api gateway). This makes it possible to scale the service depending on the customer request load. This also makes is possible to create a custom dashboard and Swagger documentation page for a single customer.

REST

This is the ONLY service which has “public” endpoints which can be called over the internet. The endpoints are REST endpoints and accept json messages. The service will produce a swagger endpoint which documents the REST endpoints: https://test.api.acceptatie.parro.com/api/docs/

The service uses the NestJS framework (https://docs.nestjs.com/) which gives us an express server (http://expressjs.com/).

The REST endpoints can be found in the controllers package in the /apps/customer-api-gateway directory

NATS

Request/Reply

subject description
organisation.v1.get_organisation To check if the provided BRIN of a message is valid the service will sent a request to the organisation subject
message.v1.validate To validate the message the service will sent a request to the validaion subject

Consuming

This service does not consume messages from NATS

Publishing

subject description
message.v1.ingest Then the message is valid it wil be published to the ingest subject
connect.v1.error When an error is thrown a message will be published on the error subject

Authorization

This is the only service which requires a bearer token in the http request header. It will validate the token against the Parro idp to match is with the configured audiance of the service. The deployed customer api gateway is configured to allow requests for a single Parro oauth client, since every Nexus partner gets its own instance of this service,