Shared Spring Boot building blocks for OpenDataJungle projects.
- OAuth2/JWT resource server security, with a permissive profile for
test/local - Configurable CORS
- Global exception handler with a consistent JSON error payload
- Request tracing via MDC (correlation ID, user, IP, duration...)
- Preconfigured
RestClientHTTP client - Common utilities (
StringUtils,CollectionUtils,DateUtils,UserUtils)
<dependency>
<groupId>com.opendatajungle</groupId>
<artifactId>opendatajungle-commons</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>./mvnw verify| Variable | Description | Default |
|---|---|---|
JWT_ISSUER_URI |
OAuth2/OIDC issuer used to validate JWTs | http://localhost:8090/realms/master |
JWT_AUDIENCES |
Expected JWT audience(s) | account |
| Variable | Description | Default |
|---|---|---|
CORS_ALLOWED_ORIGINS |
Allowed origins | localhost dev ports |
CORS_ALLOWED_METHODS |
Allowed HTTP methods | GET,POST,PUT,PATCH,DELETE,OPTIONS |
CORS_ALLOWED_HEADERS |
Allowed headers | Authorization,Content-Type,X-Requested-With,Accept,Origin,... |
CORS_EXPOSED_HEADERS |
Headers exposed to the client | Access-Control-Allow-Origin,Access-Control-Allow-Credentials |
CORS_ALLOW_CREDENTIALS |
Allow credentials | false |
CORS_MAX_AGE |
Preflight cache duration (seconds) | 3600 |
| Variable | Description | Default |
|---|---|---|
HTTP_CLIENT_CONNECT_TIMEOUT / HTTP_CLIENT_READ_TIMEOUT |
Timeouts for outbound calls (seconds) | 5 / 10 |
LOGGING_LEVEL_OPENDATAJUNGLE |
Log level for com.opendatajungle packages |
INFO |
JACKSON_TIME_ZONE |
Jackson timezone | UTC |
Issues and pull requests are welcome: https://github.com/OpenDataJungle/OpenDataJungle-Commons
- Website: www.opendatajungle.com
- Email: contact@opendatajungle.com
- Organization: github.com/OpenDataJungle
Licensed under the GNU General Public License v3.0.