Commit Graph

31 Commits

Author SHA1 Message Date
Simone Gotti 05ae46a72d gateway: move run logic from api to actions 2019-05-06 00:00:45 +02:00
Simone Gotti 6b5bd40417 gateway: move remaining remotesource logic from api to actions 2019-05-05 14:54:16 +02:00
Simone Gotti 42184d0b5b gateway: move remaining user logic from api to actions 2019-05-05 14:45:19 +02:00
Simone Gotti 96918e9bad gateway: move remaining org logic from api to actions 2019-05-05 14:36:14 +02:00
Simone Gotti c889c2c1c2 gateway: move remaining project(group) logic from api to actions 2019-05-05 14:27:22 +02:00
Simone Gotti 64044df94d gateway: move secret logic from api to actions 2019-05-05 14:11:29 +02:00
Simone Gotti f73f0ba434 gateway: move variable logic from api to actions 2019-05-04 15:16:49 +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 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 ab7e4b8a4b gateway: add user remote repos API 2019-05-03 00:11:11 +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 41e333d7ec *: rename "lts" to "ost"
`lts` was choosen to reflect a "long term storage" but currently it's just an
object storage implementation. So use this term and "ost" as its abbreviation
(to not clash with "os").
2019-04-27 15:16:48 +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 7d787c5f77 *: implement task approval 2019-04-08 17:29:57 +02:00
Simone Gotti 81537f882f gateway: fix runs url to plural 2019-04-08 16:11:19 +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 763d77d899 gateway: rename projectid to projectref 2019-04-08 09:04:55 +02:00
Simone Gotti f3781c9087 *: fix rest methods
* use POST instead of PUT for resource creation
* use PUT instead of POST for resource special actions
2019-04-08 08:54:45 +02:00
Simone Gotti fe5bc2fa31 gw repos: use config provided gitServerURL 2019-04-05 16:23:54 +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 c4310be7de Implement user token delete 2019-04-05 15:01:57 +02:00
Simone Gotti 84879bf591 gateway: limit requests to a predefined max size 2019-04-03 16:59:17 +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 3e3a7a0ea5 gateway: move user la and login validation to command layer 2019-03-29 14:33:41 +01:00
Simone Gotti 50547a6490 initial secret and variables impl 2019-03-14 14:36:18 +01:00
Simone Gotti 8b92b6f55c initial project group impl
and related api updated
2019-03-14 14:36:18 +01:00
Simone Gotti a4ad66ac2d gateway: implement initial basic run restart 2019-03-04 16:12:07 +01:00
Simone Gotti 41002efbff *: add organizations 2019-02-28 15:52:35 +01:00
Simone Gotti fd486bbe09 gateway: add internal git server repos api 2019-02-22 09:34:48 +01:00
Simone Gotti 021a0465ce gateway: initial implementation 2019-02-21 17:58:25 +01:00