Categorygithub.com/ONSdigital/dp-api-router
modulepackage
2.19.0+incompatible
Repository: https://github.com/onsdigital/dp-api-router.git
Documentation: pkg.go.dev

# README

dp-api-router

A service which routes API requests to the correct services. In the future this may add additional header information which will be used by the services.

JSON-LD

This service is responsible for serving a JSON-LD @context field on configured API routes. In order to update the JSON-LD files, follow this guide. Once the files have been updated, consider if the secrets for this service need to be updated to point to a new file location or not.

Configuration

Environment variableDefaultDescription
ALLOWED_ORIGINS"http://localhost:8081"
BIND_ADDR":23200"The host and port to bind to
ENV_HOST"http://localhost:23200"The public host for the environment the service is running on
VERSION"v1"The version of the API
ENABLE_AUDITfalse
ENABLE_OBSERVATION_APIfalse
ENABLE_PRIVATE_ENDPOINTStrueIf private endpoints should be routed
ENABLE_V1_BETA_RESTRICTIONfalse
ENABLE_SESSIONS_APIfalse
ENABLE_RELEASE_CALENDAR_APIfalseFlag to enable routing to the release calendar API
ENABLE_CANTABULAR_METADATA_EXTRACTOR_APIfalseFlag to enable routing to the cantabular metadata extractor API
ENABLE_ZEBEDEE_AUDITfalse
ENABLE_NLP_SEARCH_APISfalseFlag to enable routing to the NLP search APIs
CONTEXT_URL""A URL to the JSON-LD context file describing the APIs
API_POC_URL"http://localhost:3000"A URL to the poc api
IMPORT_API_URL"http://localhost:21800"A URL to the import api
DATASET_API_URL"http://localhost:22000"A URL to the dataset api
FILTER_API_URL"http://localhost:22100"A URL to the filter api
RECIPE_API_URL"http://localhost:22300"A URL to the recipe api
CODE_LIST_API_URL"http://localhost:22400"A URL to the code list api
HIERARCHY_API_URL"http://localhost:22600"A URL to the hierarchy api
SEARCH_API_URL"http://localhost:23900"A URL to the search api
DIMENSION_SEARCH_API_URL"http://localhost:23100"A URL to the dimension search api
SESSIONS_API_URL"http://localhost:24400"A URL to the sessions api
OBSERVATION_API_URL"http://localhost:24500"A URL to the observation api
IMAGE_API_URL"http://localhost:24700"A URL to the image api
UPLOAD_SERVICE_API_URL:"http://localhost:25100"A URL to the upload service api
FILES_API_URL:"http://localhost:26900"A URL to the files API
DOWNLOAD_SERVICE_URL:"http://localhost:23600"A URL to the download service API
IDENTITY_API_URL:"http://localhost:25600"A URL to the identity api
IDENTITY_API_VERSIONS"v1"A comma delimted string with a list of versions supported by identity api
PERMISSIONS_API_URL:"http://localhost:25400"A URL to the permissions api
PERMISSIONS_API_VERSIONS"v1"A comma delimted string with a list of versions supported by permissions api
RELEASE_CALENDAR_API_URL"http://localhost:27800"A URL to the release calendar api
ZEBEDEE_URL"http://localhost:8082"A URL to the zebedee service api
CANTABULAR_METADATA_EXTRACTOR_API_URL"http://localhost:28300"A URL to the Cantabular metadata extractor API
SEARCH_SCRUBBER_API_URL"http://localhost:28700"A URL to the Cantabular metadata extractor API
SEARCH_SCRUBBER_API_VERSIONS"v1"A comma delimted string with a list of versions supported by search scrubber api
CATEGORY_API_URL"http://localhost:28800"A URL to the NLP Category API
CATEGORY_API_VERSIONS"v1"A comma delimted string with a list of versions supported by search scrubber api
BERLIN_API_URL"http://localhost:28900"A URL to the NLP Berlin API
BERLIN_API_VERSIONS"v1"A comma delimted string with a list of versions supported by search scrubber api
KAFKA_ADDRlocalhost:9092The list of kafka hosts
KAFKA_MAX_BYTES2000000The maximum bytes that can be sent in an event to kafka topic
KAFKA_VERSION"1.0.2"The kafka version that this service expects to connect to
KAFKA_SEC_PROTOunset (only TLS)if set to TLS, kafka connections will use TLS
KAFKA_SEC_CLIENT_KEYunsetPEM [2] for the client key (optional, used for client auth) [1]
KAFKA_SEC_CLIENT_CERTunsetPEM [2] for the client certificate (optional, used for client auth) [1]
KAFKA_SEC_CA_CERTSunsetPEM [2] of CA cert chain if using private CA for the server cert [1]
KAFKA_SEC_SKIP_VERIFYfalseignore server certificate issues if set to true [1]
KAFKA_MIN_HEALTHY_BROKERS0The minimum number of healthy brokers, else app stays unhealthy [3]
AUDIT_TOPICauditThe kafka topic name for audit events
HEALTHCHECK_INTERVAL30sThe period of time between health checks
HEALTHCHECK_CRITICAL_TIMEOUT90sThe period of time after which failing checks will result in critical global check
SHUTDOWN_TIMEOUT5sThe graceful shutdown timeout (time.Duration format)
HTTP_WRITE_TIMEOUTdp-net defaultHow long the dispatcher waits for us to write to it (time.Duration format)
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317Host and port for the OpenTelemetry endpoint
OTEL_SERVICE_NAMEdp-api-routerService name to report to telemetry tools

Notes:

  1. Ignored unless using TLS (i.e. KAFKA_SEC_PROTO has a value enabling TLS)

  2. PEM values are identified as those starting with -----BEGIN and can use \n (sic) instead of newlines (they will be converted to newlines before use). Any other value will be treated as a path to the given PEM file.

  3. the default is 0 which means "use library default" - recommended to change this only in development (e.g. when running only one broker)

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

BuildTime represents the time in which the service was built.
GitCommit represents the commit (SHA-1) hash of the service that is running.
Version represents the version of the service that is running.