The consumption of API endpoints is an addition to the default IDS interaction that allows to exchange API endpoints. This allows for existing HTTP services to work over IDS. For this the OpenAPI Data App is used.
The process of consuming an API is as follows:
The test connector deployed at https://test-connector.playground.dataspac.es/ui/ provides an agent that exposes an test server implementing the https://httpbin.org/ API specification.
docker-compose.yml
: https://tno-tsg.gitlab.io/assets/playground/docker-compose.ymlapplication.yaml
: https://tno-tsg.gitlab.io/assets/playground/application.yamldocker-compose.yml
: cachain.crt
, component.crt
, component.key
with the PEM-based CA chain, public and private keysinfo.idsid
, info.curator
, info.maintainer
to the corresponding identifiers that you filled in during creation of the certificates. info.idsid
should be the Connector ID, and info.curator
, info.maintainer
should be the Participant ID.playground
but this can be changed to a more secure password, which is especially needed for public Kubernetes deployments.
security.users[0].password
to a new BCrypt encoded password (e.g. via https://bcrypt-generator.com/)To deploy the TSG Core Container execute:
docker-compose up -d
The containers will be deployed in detached mode, the user interface of the TSG Core Container will be available at: http://localhost:31000
To follow the logs of the TSG Core Container execute:
docker-compose logs -f tsg-core-container
An OpenAPI Data App is deployed on https://test-connector.playground.dataspac.es. This OpenAPI Data App forwards the requests that are sent to it a service implementing the https://httpbin.org/ API specification.
To test if the deployment worked correctly, visit http://localhost:31001/#/. This contains a very simple form where you can enter a message which is sent to the httpbin OpenAPI data app. If everything is setup correctly, you should see the message you sent being returned in a response.
If you want, you can also write a custom client app that communicates with httpbin. For this, you only have to change the image name in the httpbin-ui container. Make sure that your application adds the FORWARD_TO
, FORWARD_SENDER
, FORWARD_RECIPIENT
, FORWARD_ACCESSURL
and API_BACKEND
headers to its outgoing requests.
This step is especially useful if you are going to provide an API.
If you do not want to proceed with other tutorials, you can remove the resources used.
To clean-up all resources of the playground execute, in the same folder as the docker-compose.yml
file:
docker-compose down