SOGo 6 Interfaces
Interfaces are responsible for calling the different Modules needed for the request AND creating the json response and the status code. They have the least logic possible, so often they will just call a Module method and nothing else. They may have logic that can be triggered without needing the module.
|
E.g. the request updates the main account by adding a new identity but the admin doesn’t allow that: The interface directly returns a 404 instead of calling a module method. |
Interface cannot import files from API, Managers or other Interfaces. They can import from utils.
Interface must catch RequestException that may be raised by Modules and Managers.
Interface must use the create_api_base_response to return data to APIs.
There must be one Interface for one API file
List of Interfaces
[User] Interface System
Returns any parameters needed by UI/client when starting. E.g. whether the login is in two steps or one.
|
Do not mistake for System settings, managed by Admin Config |
[USER] Interface User Profile
Returns all parameters that define the UI/client behavior for an authenticated user
|
Do not mistake for table User Profiles |
[USER] Interface Mail Mailboxes
Manage mailboxes of a user (main account, external accounts, identities, certificates), delegations and mail sending