New KOBI documentation is available: https://adeo-ccdp.gitbook.io/kobi/

Kobi Java Starters Migration from 2.5 to 2.6.6

Features

  • Static site common file (js & css)
  • Security annotation (Xss)
  • Registration with security header allowing to use an Api Gateway.

Steps to migrate your project

Maven configuration

In the pom.xml file, update :

  • the version of kobi-starters to 2.6.6
  • the version of janino to 3.1.2 if you use janino library
1
2
3
4
<properties>
    <kobi.version>2.6.6</kobi.version>
    <janino.version>3.1.2</janino.version>
</properties>
Kobi starter include spring boot 2.2.8 version.
If you are overwriting Spring Boot with a version lower than 2.2.6 and use Janino library, you should use janino 3.1.0 version.
We recommend you to use the version provided by the Kobi starter.

Vault configuration

You can add some headers when your application register to Kobi Registry API.

In your vault configuration, add one or more headers like this :

1
2
3
4
5
6
7
"kobi.registration": {
  "base-url": "<api gateway url for kobi registry api>",
  headers:
    "firstHeaderName": "value"
    "secondHeaderName": "value"
    ...
}

You can enable the registration debug logging to see the request’s details :

1
2
logging.level.io.kobi.registry.client.config: DEBUG
logging.level.io.kobi.starter.registration: DEBUG

To register through the api gateway, you have to add your application in the api gateway (https://developer.leroymerlin.fr/) then ask for access to API Kobi registry (v2) (Repeat this operation for each environment).
Once you have access to the Kobi Registry API through the api gateway, you will be given an api key and routing gateway header.

Here is an example of configuration with a Gateway API :

1
2
3
4
5
6
7
"kobi.registration": {
  "base-url": "<api gateway url for kobi registry api>",
  headers:
    "X-Gateway-APIKey": "the given key from DevPortal"
    "X-BU-Code": "LMIT"
    ...
}