Commit Graph

7 Commits

Author SHA1 Message Date
Simone Gotti 42184d0b5b gateway: move remaining user logic from api to actions 2019-05-05 14:45:19 +02:00
Simone Gotti 3f7e554f04 gateway: rename command(handler) to action(handler)
Since we're going to migrate all actions (also queries that now are implemented
in the api handlers) there
2019-05-03 23:48:49 +02:00
Simone Gotti 3642be6f21 */api: Use helpers for error handling
* client: always parse the json error message field and return its contents
* Use ErrBadRequest and ErrNotFound in every handler and command
* Gateway: by default pass underlying service error (configstore, runservice) to
client keeping the status code and message. In future, if some errors must be
masked, we should change the specific parts that need special handling.
2019-04-09 14:53:00 +02:00
Simone Gotti 56d903d4db gateway api: improve response handling
* Always return a json message also on error. For internal errors return a
generic "internal server error" message to not leak the real internal error to
clients
* Return 201 Created on resource creation
* Return 204 No Content on resource deletion and other action with no json
output
2019-04-08 11:35:45 +02:00
Simone Gotti 595590e611 api: use httpError helper everywhere 2019-04-05 16:33:00 +02:00
Simone Gotti eb8cd9cc52 gateway: add user registration
Adds two handler:

* Authorize handler used to ask remote source authorization
* Register handler used to do user and related linked account creation
2019-03-29 17:53:15 +01:00
Simone Gotti 021a0465ce gateway: initial implementation 2019-02-21 17:58:25 +01:00