All micro services will communicate with the Core service via a secure token protocol. Once installed, the core will generate a unique key (called shared secret from now on) which will be used by all micro services' first communication (called first handshake from now on). On first handshake, the core will generate a unique key for each micro service which will be used from then on to access the core's features. Also, during this process, the micro service will send the core all it's frontend JS modules urls along with it's base url.
Table of Contents |
---|
Doing the first handshake - backend
The core will expose a public endpoint called registerMicroservice which will be used to register a new micro service with the core.
...
Request | |||||||
---|---|---|---|---|---|---|---|
Endpoint URL: /api/registerMicroservice | |||||||
Method: POST | |||||||
Headers | |||||||
Parameter | Description | ||||||
X-Api-Key | Shared secret generated by Core, provided by the core administrator (should be visible via the core dashboard) | ||||||
X-Requested-With | Value should always be XMLHttpRequest (depending on the technology used, this header could already be present in the request) | ||||||
Body | |||||||
Parameter | Required | Description | |||||
name | Yes | Module friendly name (no limitations, can be changed in time example: OMS Events module) | |||||
code | yes | Module internal name (no spaces, all lowercase, cannot be changed once registered, example: oms_events) | |||||
base_url | yes | Module base url (URL where the module is accessible, the frontend root, example: https://moduleName.domain.tld) | |||||
pages | yes | JSON array containing frontend pages data Each entity inside the array should contain the following attributes: name - Frontend friendly name (example: List events) code - Frontend internal name (example: list_events) - This one should be the same with the AngularJS module name defined in the module module_link - relative path to base_url to the module JS file (example: frontend/list_events.js)
|
...
Response | |||
Response | Description | ||
---|---|---|---|
| Returns success flag and the handshake token which will be used for further calls to the core | ||
| Error call | ||
| Unauthorized call. Shared secret invalid |
Doing the first handshake - frontend
Warning |
---|
Each micro service is responsible for managing it's own frontend! |
...