Joachim Van Herwegen a47f5236ef feat: Full rework of account management
Complete rewrite of the account management and related systems.
Makes the architecture more modular,
allowing for easier extensions and configurations.
2023-10-06 11:04:40 +02:00

28 lines
1.7 KiB
Markdown

# JSON API controls
A large part of every response of the JSON API is the `controls` block.
These are generated by using nested `ControlHandler` objects.
These take as input a key/value with the values being either routes or other interaction handlers.
These will then be executed to determine the values of the output JSON object, with the same keys.
By using other `ControlHandler`s in the input map, we can create nested objects.
The default structure of these handlers is as follows:
```mermaid
flowchart LR
RootControlHandler("<strong>RootControlHandler</strong><br>ControlHandler")
RootControlHandler --controls--> ControlHandler("<strong>ControlHandler</strong><br>ControlHandler")
ControlHandler --main--> MainControlHandler("<strong>MainControlHandler</strong><br>ControlHandler")
ControlHandler --account--> AccountControlHandler("<strong>AccountControlHandler</strong><br>ControlHandler")
ControlHandler --password--> PasswordControlHandler("<strong>PasswordControlHandler</strong><br>ControlHandler")
ControlHandler --"oidc"--> OidcControlHandler("<strong>OidcControlHandler</strong><br>OidcControlHandler")
ControlHandler --html--> HtmlControlHandler("<strong>HtmlControlHandler</strong><br>ControlHandler")
HtmlControlHandler --main--> MainHtmlControlHandler("<strong>MainHtmlControlHandler</strong><br>ControlHandler")
HtmlControlHandler --account--> AccountHtmlControlHandler("<strong>AccountHtmlControlHandler</strong><br>ControlHandler")
HtmlControlHandler --password--> PasswordHtmlControlHandler("<strong>PasswordHtmlControlHandler</strong><br>ControlHandler")
```
Each of these control handlers then has a map of routes which link to the actual API endpoints.
How to add these can be seen [here](routes.md#adding-the-necessary-controls).