This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccount/routes/web.php
2019-11-22 16:13:42 +01:00

141 lines
8.3 KiB
PHP

<?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']);
#$router->get('/api/v4/user', ['uses' => 'oAuthController@getUserTMP']);
#$router->get('/api/v4/groups', ['uses' => 'oAuthController@getGroupsTMP']);
//Gitlab like oauth
$router->group(['prefix' => 'gitlab', 'middleware' => 'gui'], function () use ($router) {
$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']);
});
//Oauth URLS, moved to /api, this is just that old versions still work
$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
$router->group(['prefix' => 'api'], function () use ($router) {
$router->group(['prefix' => 'v1'], function () use ($router) {
$router->get("status/check", ["uses" => "StatusController@check"]);
$router->group(['prefix' => 'user'], function () use ($router) {
$router->post("/login", ['uses' => 'API\UserController@passwordLogin']);
$router->post("/check", ['uses' => 'API\UserController@checkPassword']);
$router->post("/register", ['uses' => 'API\UserController@register']);
$router->get("/captcha", ['uses' => 'API\UserController@reCAPTCHA']);
$router->get("/invites", ['uses' => 'API\UserController@getInviteCodeInfo']);
$router->get("/me", ['uses' => 'API\UserController@me']);
$router->get("/me/mails", ['uses' => 'API\UserController@listMails']);
$router->post("/me/mails", ["uses" => "API\UserController@addMail"]);
$router->post("/me/changePassword", ["uses" => "API\UserController@changePassword"]);
$router->group(['prefix' => '/me/mail/{id}'], function () use ($router) {
$router->delete("", ['uses' => 'API\UserController@removeMail']);
$router->post("/markAsPrimary", ["uses" => "API\UserController@changePrimaryMail"]);
});
});
$router->group(['prefix' => 'app'], function () use ($router) {
$router->get("/", ['uses' => 'API\AppController@listApps']);
$router->post("/", ['uses' => 'API\AppController@createApp']);
$router->get("/find", ['uses' => 'API\AppController@findApp']);
$router->group(['prefix' => '{id}'], function () use ($router) {
$router->get("/", ['uses' => 'API\AppController@appDetails']);
$router->put("/", ['uses' => 'API\AppController@updateApp']);
$router->get("/access", ["uses" => "API\oAuthController@getAccess"]);
$router->post("/access/allow", ["uses" => "API\oAuthController@allowAccess"]);
$router->get("/user", ["uses" => "API\AppController@getUsers"]);
$router->post("/changeImage", ["uses" => "API\AppController@changeImage"]);
});
});
$router->group(["prefix" => "access"], function () use ($router) {
$router->get("", ["uses" => "API\oAuthController@listAccess"]);
$router->delete("/{id}", ["uses" => "API\oAuthController@removeAccess"]);
});
$router->group(['prefix' => 'account'], function () use ($router) {
$router->get("/", ['uses' => 'API\AccountController@getUsers']);
$router->get("/{id}", ['uses' => 'API\AccountController@getUser']);
});
$router->group(['prefix' => 'oauth'], function () use ($router) {
$router->get("/authorize", ['middleware' => 'gui', 'uses' => 'oAuthController@authorizeView']);
$router->post("/token", ['uses' => 'oAuthController@token']);
});
$router->group(['prefix' => 'server'], function () use ($router) {
$router->get("/settings", ["uses" => "API\ServerController@getSettings"]);
});
$router->group(['prefix' => 'admin'], function () use ($router) {
$router->post("/settings", ["uses" => "API\ServerController@saveSettings"]);
});
});
});
$router->get("status/check", ["uses" => "StatusController@check"]);
$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']);
$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']);
$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']);
$router->post('/apps/{id}', ['uses' => 'GUI\AppController@updateApp']);
$router->post('/apps/{id}/changeIcon', ['uses' => 'GUI\AppController@changeIcon']);
$router->get('/apps/{id}/regenerateAPISecret', ['uses' => 'GUI\AppController@regenerateAppSecret']);
$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"]);
$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']);
$router->get("/admin/resendInviteMail", ["uses" => 'GUI\AdminController@resendValidationMail']);
$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']);
});