The eligibility-signposting-api is based on an OpenAPI specification maintained at /specification/eligibility-signposting-api.yaml. We use Redocly CLI to inject environment-specific elements into the base specification, allowing us to publish to different environments without manual editing or maintaining duplicate specifications.
Each directory contains environment specific configuration for the specification. If the configuration doesn't exist for your chosen environment, then add it.
Contains environment-specific security configurations for each endpoint.
Contains APIM extensions to the OpenAPI specification with deployment requirements:
- access: Environment-specific access patterns
- rate-limit: API rate limiting configurations
- target: API backend details for proxy configuration
To build a specification for a specific environment:
- Make sure you've run the initial setup command
make install-node. - Set the target environment using the
APIM_ENVparameter (dev, test, preprod, prod, sandbox) - Run
make construct-specfrom the repository root, which:- Updates templates with environment-specific values
- Uses Redocly to compile the complete specification to
build/specification/$(APIM_ENV)/
- For the
sandboxenvironment, runmake generate-sandbox-specto convert the specification to JSON and save it tosandbox/specification/for immediate use.
See the Proxygen CLI user guide
We deploy our specifications using the Proxygen CLI. In order to do this, the following steps need to be performed:
- Construct the specification for the environment of your choice, following the instructions above.
- Activate a poetry environment
poetry env activate- you may need to runmake install-pythonto install poetry etc. first. - Run
make retrieve-proxygen-keyfrom the root directory to retrieve the private key needed to authenticate with Proxygen. - Run
make setup-proxygen-credentialsfrom the root directory to set up credentials needed to interact with our API proxy. - Run
proxygen instance deploy <environment> eligibility-signposting-api ./build/specification/<env>/eligibility-signposting-api.yamlto deploy the specification to a chosen environment.
- To get the currently published specification run
make get-specfor production ormake get-spec-uatfor non-production. This will return an error if a specification is not deployed. - To publish a specification, generate an appropriate specification (prod for production, preprod for uat) above then run
make publish-specfor production ormake publish-spec-uatfor non-production. - To delete a specification, run
make delete-specfor production ormake delete-spec-uatfor non-production