2019-04-24 18:46:41 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Application Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here is where you can register all of the routes for an application.
|
|
|
|
| It is a breeze. Simply tell Lumen the URIs it should respond to
|
|
|
|
| and give it the Closure to call when that URI is requested.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
$router->get('/', ['middleware' => 'gui', 'uses' => 'GUI\PublicController@index']);
|
2019-04-25 15:33:15 +00:00
|
|
|
#$router->get('/api/v4/user', ['uses' => 'oAuthController@getUserTMP']);
|
|
|
|
#$router->get('/api/v4/groups', ['uses' => 'oAuthController@getGroupsTMP']);
|
2019-04-24 18:46:41 +00:00
|
|
|
|
2019-04-25 12:19:16 +00:00
|
|
|
//Gitlab like oauth
|
|
|
|
$router->group(['prefix' => 'gitlab', 'middleware' => 'gui'], function () use ($router) {
|
2019-04-25 15:33:15 +00:00
|
|
|
$router->group(['prefix' => 'oauth'], function () use ($router) {
|
|
|
|
$router->get("/authorize", ['middleware' => 'gui', 'uses' => 'oAuthController@authorizeView']);
|
|
|
|
$router->post("/authorize", ['middleware' => 'gui', 'uses' => 'oAuthController@authorizeDo']);
|
|
|
|
$router->post("/token", ['uses' => 'oAuthController@token']);
|
|
|
|
});
|
|
|
|
$router->get('/api/v4/user', ['uses' => 'oAuthController@getUserTMP']);
|
|
|
|
$router->get('/api/v4/groups', ['uses' => 'oAuthController@getGroupsTMP']);
|
2019-04-25 12:19:16 +00:00
|
|
|
});
|
|
|
|
|
2019-07-17 16:34:08 +00:00
|
|
|
//Oauth URLS, moved to /api, this is just that old versions still work
|
2019-04-25 12:19:16 +00:00
|
|
|
$router->group(['prefix' => 'oauth'], function () use ($router) {
|
|
|
|
$router->get("/authorize", ['middleware' => 'gui', 'uses' => 'oAuthController@authorizeView']);
|
|
|
|
$router->post("/authorize", ['middleware' => 'gui', 'uses' => 'oAuthController@authorizeDo']);
|
|
|
|
$router->post("/token", ['uses' => 'oAuthController@token']);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//Internal API
|
2019-05-22 12:44:51 +00:00
|
|
|
$router->group(['prefix' => 'api'], function () use ($router) {
|
2019-04-25 15:33:15 +00:00
|
|
|
$router->group(['prefix' => 'v1'], function () use ($router) {
|
2019-11-19 17:41:55 +00:00
|
|
|
$router->get("status/check", ["uses" => "StatusController@check"]);
|
2019-05-22 12:44:51 +00:00
|
|
|
$router->group(['prefix' => 'user'], function () use ($router) {
|
|
|
|
$router->post("/login", ['uses' => 'API\UserController@passwordLogin']);
|
2019-11-19 17:41:55 +00:00
|
|
|
$router->post("/check", ['uses' => 'API\UserController@checkPassword']);
|
2019-05-22 12:44:51 +00:00
|
|
|
$router->post("/register", ['uses' => 'API\UserController@register']);
|
|
|
|
$router->get("/captcha", ['uses' => 'API\UserController@reCAPTCHA']);
|
|
|
|
$router->get("/invites", ['uses' => 'API\UserController@getInviteCodeInfo']);
|
2019-06-06 13:44:45 +00:00
|
|
|
$router->get("/me", ['uses' => 'API\UserController@me']);
|
2019-08-11 20:08:56 +00:00
|
|
|
$router->get("/me/mails", ['uses' => 'API\UserController@listMails']);
|
2019-11-19 17:41:55 +00:00
|
|
|
$router->post("/me/mails", ["uses" => "API\UserController@addMail"]);
|
|
|
|
$router->group(['prefix' => '/me/mail/{id}'], function () use ($router) {
|
|
|
|
$router->delete("", ['uses' => 'API\UserController@removeMail']);
|
|
|
|
});
|
2019-06-06 13:44:45 +00:00
|
|
|
});
|
|
|
|
$router->group(['prefix' => 'app'], function () use ($router) {
|
|
|
|
$router->get("/", ['uses' => 'API\AppController@listApps']);
|
2019-07-17 17:21:15 +00:00
|
|
|
$router->post("/", ['uses' => 'API\AppController@createApp']);
|
2019-06-06 13:44:45 +00:00
|
|
|
$router->get("/find", ['uses' => 'API\AppController@findApp']);
|
|
|
|
$router->group(['prefix' => '{id}'], function () use ($router) {
|
|
|
|
$router->get("/", ['uses' => 'API\AppController@appDetails']);
|
2019-06-20 17:07:17 +00:00
|
|
|
$router->put("/", ['uses' => 'API\AppController@updateApp']);
|
2019-06-20 14:46:50 +00:00
|
|
|
$router->get("/access", ["uses" => "API\oAuthController@getAccess"]);
|
2019-06-20 16:03:54 +00:00
|
|
|
$router->post("/access/allow", ["uses" => "API\oAuthController@allowAccess"]);
|
2019-06-20 17:07:17 +00:00
|
|
|
$router->get("/user", ["uses" => "API\AppController@getUsers"]);
|
2019-09-24 14:02:39 +00:00
|
|
|
$router->post("/changeImage", ["uses" => "API\AppController@changeImage"]);
|
2019-06-06 13:44:45 +00:00
|
|
|
});
|
2019-05-22 12:44:51 +00:00
|
|
|
});
|
2019-09-25 07:56:36 +00:00
|
|
|
$router->group(["prefix" => "access"], function () use ($router) {
|
|
|
|
$router->get("", ["uses" => "API\oAuthController@listAccess"]);
|
2019-09-25 08:54:46 +00:00
|
|
|
$router->delete("/{id}", ["uses" => "API\oAuthController@removeAccess"]);
|
2019-09-25 07:56:36 +00:00
|
|
|
});
|
2019-04-25 15:33:15 +00:00
|
|
|
$router->group(['prefix' => 'account'], function () use ($router) {
|
|
|
|
$router->get("/", ['uses' => 'API\AccountController@getUsers']);
|
|
|
|
$router->get("/{id}", ['uses' => 'API\AccountController@getUser']);
|
|
|
|
});
|
2019-07-17 16:34:08 +00:00
|
|
|
$router->group(['prefix' => 'oauth'], function () use ($router) {
|
|
|
|
$router->get("/authorize", ['middleware' => 'gui', 'uses' => 'oAuthController@authorizeView']);
|
|
|
|
$router->post("/token", ['uses' => 'oAuthController@token']);
|
|
|
|
});
|
2019-08-11 20:08:56 +00:00
|
|
|
$router->group(['prefix' => 'server'], function () use ($router) {
|
|
|
|
$router->get("/settings", ["uses" => "API\ServerController@getSettings"]);
|
|
|
|
});
|
2019-04-25 15:33:15 +00:00
|
|
|
});
|
2019-04-25 12:19:16 +00:00
|
|
|
});
|
2019-05-22 12:44:51 +00:00
|
|
|
|
2019-08-11 20:08:56 +00:00
|
|
|
|
2019-07-10 15:04:35 +00:00
|
|
|
$router->get("status/check", ["uses" => "StatusController@check"]);
|
2019-04-24 18:46:41 +00:00
|
|
|
|
|
|
|
$router->group(['prefix' => 'gui', 'middleware' => 'gui'], function () use ($router) {
|
|
|
|
$router->get('/register', ['uses' => 'GUI\AccountController@registerView']);
|
|
|
|
$router->post('/register', ['uses' => 'GUI\AccountController@register']);
|
|
|
|
|
|
|
|
$router->get('/invite', ['uses' => 'GUI\AccountController@inviteView']);
|
2019-05-02 10:47:41 +00:00
|
|
|
$router->get('/passwordReset', ['uses' => 'GUI\AccountController@recoverPasswordView']);
|
|
|
|
$router->post('/passwordReset', ['uses' => 'GUI\AccountController@recoverPassword']);
|
|
|
|
$router->get('/passwordReset/{userId}/{code}', ['uses' => 'GUI\AccountController@recoveryPasswordNewPasswordView']);
|
|
|
|
$router->post('/passwordReset/{userId}/{code}', ['uses' => 'GUI\AccountController@recoveryPasswordNewPassword']);
|
2019-04-24 18:46:41 +00:00
|
|
|
|
|
|
|
$router->get('/login', ['uses' => 'GUI\AccountController@loginView']);
|
|
|
|
$router->get('/logout', ['uses' => 'GUI\AccountController@logout']);
|
|
|
|
$router->post('/login', ['uses' => 'GUI\AccountController@login']);
|
|
|
|
$router->get('/apps', ['uses' => 'GUI\AppController@appList']);
|
|
|
|
$router->get('/apps/new', ['uses' => 'GUI\AppController@newAppView']);
|
|
|
|
$router->post('/apps/new', ['uses' => 'GUI\AppController@newApp']);
|
|
|
|
$router->get('/apps/{id}', ['uses' => 'GUI\AppController@viewApp']);
|
2019-04-25 10:03:34 +00:00
|
|
|
$router->post('/apps/{id}', ['uses' => 'GUI\AppController@updateApp']);
|
2019-04-24 18:46:41 +00:00
|
|
|
$router->post('/apps/{id}/changeIcon', ['uses' => 'GUI\AppController@changeIcon']);
|
2019-05-02 13:22:37 +00:00
|
|
|
$router->get('/apps/{id}/regenerateAPISecret', ['uses' => 'GUI\AppController@regenerateAppSecret']);
|
2019-04-24 18:46:41 +00:00
|
|
|
$router->get('/apps/{id}/icon', ['uses' => 'GUI\AppController@getAppIcon']);
|
|
|
|
$router->get("/mailValidation/{id}/{code}", ['uses' => 'GUI\AccountController@validateEMail']);
|
|
|
|
|
|
|
|
|
|
|
|
//Admin
|
|
|
|
$router->get("/admin/settings", ['uses' => 'GUI\AdminController@settingsView']);
|
|
|
|
$router->post("/admin/settings", ["uses" => "GUI\AdminController@saveSettings"]);
|
|
|
|
$router->get("/admin/apps", ["uses" => "GUI\AdminController@appList"]);
|
|
|
|
$router->get("/admin/apps/{id}", ["uses" => "GUI\AdminController@appDetails"]);
|
|
|
|
$router->post("/admin/apps/{id}", ["uses" => "GUI\AdminController@appDetailsSave"]);
|
|
|
|
$router->get("/admin/invites", ["uses" => "GUI\AdminController@inviteView"]);
|
|
|
|
$router->get("/admin/invites/new", ["uses" => "GUI\AdminController@inviteNewView"]);
|
|
|
|
$router->post("/admin/invites/new", ["uses" => "GUI\AdminController@inviteNew"]);
|
2019-04-25 12:19:16 +00:00
|
|
|
$router->get("/admin/users", ["uses" => 'GUI\AdminController@listUser']);
|
|
|
|
$router->get("/admin/users/{id}", ["uses" => 'GUI\AdminController@userDetails']);
|
|
|
|
$router->post("/admin/users/{id}", ["uses" => 'GUI\AdminController@saveUserDetails']);
|
2019-07-10 15:04:35 +00:00
|
|
|
$router->get("/admin/resendInviteMail", ["uses" => 'GUI\AdminController@resendValidationMail']);
|
2019-04-25 12:19:16 +00:00
|
|
|
|
|
|
|
|
2019-04-25 15:33:15 +00:00
|
|
|
$router->get('/profile', ['uses' => 'GUI\AccountController@profileView']);
|
|
|
|
$router->post('/profile/addMail', ['uses' => 'GUI\AccountController@addMail']);
|
|
|
|
$router->get('/profile/changePrimaryMail', ['uses' => 'GUI\AccountController@changePrimaryMail']);
|
|
|
|
$router->get('/profile/removeMail', ['uses' => 'GUI\AccountController@removeMail']);
|
|
|
|
$router->post('/profile/changePassword', ['uses' => 'GUI\AccountController@changePassword']);
|
|
|
|
|
|
|
|
$router->get('/access', ['uses' => 'GUI\AccessController@listAccess']);
|
|
|
|
$router->get('/access/rm', ['uses' => 'GUI\AccessController@removeAccess']);
|
2019-09-24 14:02:39 +00:00
|
|
|
});
|