SDA Commons Starter¶
The module sda-commons-starter
provides all basics required to build a service for the SDA Platform with
Dropwizard.
Apps built with the SdaPlatformBundle
automatically contain
- Support for environment variables in configuration files and default console appender configuration
- Trace Token support
- a tolerant
ObjectMapper
, HAL support and a field filter - Security checks on startup
- Authentication support
- Prometheus metrics
- OpenApi documentation
- Open Telemetry
- support for the Metadata Context
They may be configured easily to
Using the SdaPlatformBundle
is the easiest
and fastest way to create a service for the SDA Platform.
To bootstrap a Dropwizard application for the SDA Platform only the
SdaPlatformBundle
has to be added. The
API should be documented with Swagger annotations:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
The SdaPlatformConfiguration
may be
extended to add application specific configuration properties.
The config.yaml
of the
SdaPlatformConfiguration
supports
configuration of authentication and CORS
additionally to the defaults of Dropwizard's Configuration
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
By using .usingSdaPlatformConfiguration()
or .usingSdaPlatformConfiguration(MyCustomConfiguration.class)
the authorization including the open policy agent are automatically enabled as well as the cors settings.
Instead of .usingSdaPlatformConfiguration()
and .usingSdaPlatformConfiguration(MyCustomConfiguration.class)
, the configuration may be fully customized using
.usingCustomConfig(MyCustomConfiguration.class)
to support configurations that do not extend
SdaPlatformConfiguration
. This may
also be needed to disable some features of the starter module or add special features such as
Authorization.
Please note that .withOpaAuthorization(MyConfiguration::getAuth, MyConfiguration::getOpa)
will configure the AuthBundle
to use .withExternalAuthorization()
. Please read the
documentation of the Auth Bundle carefully before
using this option.