Commit Graph

13 Commits

Author SHA1 Message Date
Simone Gotti ea02eed2d9 * api: accept both ids or names in the same endpoint
Simplify api to accept both ids or names in the same endpoint
2019-05-03 11:07:53 +02:00
Simone Gotti 1820e7c477 types: rename user UserName field to Name 2019-04-30 12:56:43 +02:00
Simone Gotti fefa2819c9 gateway: use agola ID in gitsource tokenname 2019-04-30 12:13:12 +02:00
Simone Gotti cbd971619b gateway: refresh oauth2 token when needed
refresh the oauth2 access token when needed and update the related linked
account.
2019-04-29 15:42:10 +02:00
Simone Gotti 95e73e66a0 oauth2: correctly populate token expiry data
* Populate the field when needed
* Convert it to a time instead of a duration
2019-04-29 14:57:07 +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 03b5a53510 gateway/command: use ErrBadRequest when needed 2019-04-08 12:08:31 +02:00
Simone Gotti ac28731d11 gateway: only admin or the same logged user can create an user token 2019-04-05 15:56:06 +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 704da47afc configstore: createuser also create linked account when requested
Useful to future user registration to create user and linked account in a unique
atomic call.
2019-03-29 17:50:51 +01:00
Simone Gotti 3e3a7a0ea5 gateway: move user la and login validation to command layer 2019-03-29 14:33:41 +01:00
Simone Gotti 8b92b6f55c initial project group impl
and related api updated
2019-03-14 14:36:18 +01:00
Simone Gotti 021a0465ce gateway: initial implementation 2019-02-21 17:58:25 +01:00