Testing the API
Available APIs in the development environment
The development environment exposes two APIs from the Kubernetes cluster:
- Port 9000 uses the configuration from
enduro.toml. - Port 9002 serves the API without authentication.
The latter is used to remove the need for an access token during development,
like running make upload-sip, while the first one can be used to
test the identity and access control configuration.
Getting an access token
To access the Enduro API at port 9000 when authentication is enabled in the configuration, an access token needs to be sent in the requests. To get one from the default Keycloak instance in the environment, run the following Make command from the root of the repository:
This Make rule allows you to set three parameters to obtain an access token from a different provider. For example:
To use the client credentials flow, set CLIENT_SECRET:
After authentication, the script will output the token payload for inspection and its encoded value for API authentication.
Making requests to the API
Use the access token on each request to the API. For example:
Replace <token> with the access token value obtained with make auth.