Well-Known-Value-Service - Provides access to common values via API
500K+
Well-Known-Value-Service - Provides access to common values via API
The service ships as the container image ghga/wkvs and the Helm chart wkvs.
This service is intended to provide access to configured values via API in order to reduce the required config for other GHGA microservices.
The executable wkvs starts the service and takes no command.
Running a service shows how to start, build and deploy it.
The settings take the prefix wkvs: the environment variable WKVS_HOST sets host, and the YAML file is .wkvs.yaml.
example_config.yaml holds a complete set to adapt, and Configuration says where the service looks for them.
The service requires the following configuration parameters:
enable_opentelemetry (boolean): If set to true, this will run necessary setup code.If set to false, no setup code is run, which leaves tracing disabled.
Default: false.
otel_trace_sampling_rate (number): Determines which proportion of spans should be sampled.
A value of 1.0 means all and is equivalent to the previous behaviour.
Setting this to 0 will result in no spans being sampled, but this does not automatically set enable_opentelemetry to False.
Minimum: 0.
Maximum: 1.
Default: 1.0.
enable_otel_metrics (boolean): Also export metrics via OTLP.
Requires enable_opentelemetry and a collector with a metrics pipeline.
Default: false.
log_level (string): The minimum log level to capture.
Must be one of: "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG", or "TRACE".
Default: "INFO".
service_instance_id (string, required): A string that uniquely identifies this instance across all instances of this service.
This is included in log messages.
Examples:
"germany-bw-instance-001"
log_format: If set, will replace JSON formatting with the specified string format.
If not set, has no effect.
In addition to the standard attributes, the following can also be specified: timestamp, service, instance, level, correlation_id, and details.
Default: null.
Examples:
"%(timestamp)s - %(service)s - %(level)s - %(message)s"
"%(asctime)s - Severity: %(levelno)s - %(msg)s"
log_traceback (boolean): Whether to include exception tracebacks in log messages.
Default: true.
dcs_api_url (string, required): URL to the root of the DRS-compatible DCS API.
ucs_api_url (string, required): URL to the root of the upload controller API.
wps_api_url (string, required): URL to the root of the WPS API.
storage_aliases (object, required): Mapping of storage alias to endpoint URL for all available S3 object storages.
Can contain additional properties.
storage_labels (object, required): Mapping of storage alias to its human-readable format.
Can contain additional properties.
Examples:
{
"HD01": "Heidelberg",
"TUE01": "T\u00fcbingen"
}
crypt4gh_public_keys (object, required): Mapping of storage alias to Crypt4GH public key.
Can contain additional properties.
port (integer): Port to expose the server on the specified host.
Default: 8080.
auto_reload (boolean): A development feature.
Set to True to automatically reload the server upon code changes.
Default: false.
workers (integer): Number of workers processes to run.
Default: 1.
timeout_keep_alive (integer): The time in seconds to keep an idle connection open for subsequent requests before closing it.
This value should be higher than the timeout used by any client or reverse proxy to avoid premature connection closures.
Default: 90.
Examples:
5
90
5400
api_root_path (string): Root path at which the API is reachable.
This is relative to the specified host and port.
Default: "".
openapi_url (string): Path to get the openapi specification in JSON format.
This is relative to the specified host and port.
Default: "/openapi.json".
docs_url (string): Path to host the swagger documentation.
This is relative to the specified host and port.
Default: "/docs".
cors_allowed_origins: A list of origins that should be permitted to make cross-origin requests.
By default, cross-origin requests are not allowed.
You can use ['*'] to allow any origin.
Default: null.
Examples:
[
"https://example.org",
"https://www.example.org"
]
cors_allow_credentials: Indicate that cookies should be supported for cross-origin requests.
Defaults to False.
Also, cors_allowed_origins cannot be set to ['*'] for credentials to be allowed.
The origins must be explicitly specified.
Default: null.
Examples:
[
"https://example.org",
"https://www.example.org"
]
cors_allowed_methods: A list of HTTP methods that should be allowed for cross-origin requests.
Defaults to ['GET'].
You can use ['*'] to allow all standard methods.
Default: null.
Examples:
[
"*"
]
cors_allowed_headers: A list of HTTP request headers that should be supported for cross-origin requests.
Defaults to [].
You can use ['*'] to allow all request headers.
The Accept, Accept-Language, Content-Language, Content-Type and some are always allowed for CORS requests.
Default: null.
Examples:
[]
cors_exposed_headers: A list of HTTP response headers that should be exposed for cross-origin responses.
Defaults to [].
Note that you can NOT use ['*'] to expose all response headers.
The Cache-Control, Content-Language, Content-Length, Content-Type, Expires, Last-Modified and Pragma headers are always exposed for CORS responses.
Default: null.
Examples:
[]
generate_correlation_id (boolean): A flag, which, if False, will result in an error when inbound requests don't possess a correlation ID.
If True, requests without a correlation ID will be assigned a newly generated ID in the correlation ID middleware function.
Default: true.
Examples:
true
false
The service's OpenAPI specification is in openapi.yaml.
The Well-Known-Value-Service does not currently utilize the ports or core portions of the triple hexagonal architecture, but it does retain the adapters portion of the design in case the service is extended later.
This repository is free to use and modify according to the Apache 2.0 License.
docker pull ghga/wkvs:16.1.0Last week