Commit 7a6d9b3e authored by Claudemir Todo Bom's avatar Claudemir Todo Bom

* allow "-" on addresses and domains

parent e8ad211b
......@@ -18,51 +18,51 @@ $router->get('/', function () use ($router) {
// REST operations for user
// read user
$router->get('user/{address:[0-9A-Za-z_.@]+}',
$router->get('user/{address:[0-9A-Za-z_.\-@]+}',
[ 'middleware' => 'basic.auth' , 'uses' => 'UsersController@showOneUser']);
// create user
$router->post('user/{address:[0-9A-Za-z_.@]+}',
$router->post('user/{address:[0-9A-Za-z_.\-@]+}',
[ 'middleware' => 'basic.auth' , 'uses' => 'UsersController@createUser']);
// update user
$router->put('user/{address:[0-9A-Za-z_.@]+}',
$router->put('user/{address:[0-9A-Za-z_.\-@]+}',
[ 'middleware' => 'basic.auth' , 'uses' => 'UsersController@updateUser']);
// delete user
$router->delete('user/{address:[0-9A-Za-z_.@]+}',
$router->delete('user/{address:[0-9A-Za-z_.\-@]+}',
[ 'middleware' => 'basic.auth' , 'uses' => 'UsersController@deleteUser']);
// get access level string
$router->get('accesslevel/{address:[0-9A-Za-z_.@]+}',
$router->get('accesslevel/{address:[0-9A-Za-z_.\-@]+}',
[ 'middleware' => 'basic.auth' , 'uses' => 'UsersController@getAccessLevel']);
// change password
$router->get('setpw/{address:[0-9A-Za-z_.@]+}',
$router->get('setpw/{address:[0-9A-Za-z_.\-@]+}',
[ 'middleware' => 'basic.auth' , 'uses' => 'UsersController@generatePassword']);
// REST operations for domain
// read domain
$router->get('domain/{domain:[0-9A-Za-z_.]+}',
$router->get('domain/{domain:[0-9A-Za-z_.\-]+}',
[ 'middleware' => 'basic.auth' , 'uses' => 'DomainsController@showOneDomain']);
// create domain
$router->post('domain/{domain:[0-9A-Za-z_.]+}',
$router->post('domain/{domain:[0-9A-Za-z_.\-]+}',
[ 'middleware' => 'basic.auth' , 'uses' => 'DomainsController@createDomain']);
// update domain
$router->put('domain/{domain:[0-9A-Za-z_.]+}',
$router->put('domain/{domain:[0-9A-Za-z_.\-]+}',
[ 'middleware' => 'basic.auth' , 'uses' => 'DomainsController@updateDomain']);
// delete domain
$router->delete('domain/{domain:[0-9A-Za-z_.]+}',
$router->delete('domain/{domain:[0-9A-Za-z_\-.]+}',
[ 'middleware' => 'basic.auth' , 'uses' => 'DomainsController@deleteDomain']);
// REST operations for acl (roles)
// list acl for one target
$router->get('acl/{address:[0-9A-Za-z_.@]+[A-Za-z]}',
$router->get('acl/{address:[0-9A-Za-z_.\-@]+[A-Za-z]}',
[ 'middleware' => 'basic.auth' , 'uses' => 'ACLController@listAcl']);
// read one ACL declaration
......@@ -85,7 +85,7 @@ $router->delete('acl/{id:[0-9]+}',
$router->get('listusers',
[ 'middleware' => 'basic.auth' , 'uses' => 'UsersController@listUsers']);
$router->get('listusers/{domain:[0-9A-Za-z_.]+}',
$router->get('listusers/{domain:[0-9A-Za-z_.\-]+}',
[ 'middleware' => 'basic.auth' , 'uses' => 'UsersController@listUsers']);
$router->get('listdomains',
......@@ -94,13 +94,13 @@ $router->get('listdomains',
$router->get('checkpermission/{permission:[^/]+}[/{parameter}]',
[ 'middleware' => 'basic.auth' , 'uses' => 'UsersController@checkPermission']);
$router->get('otp/start/{address:[0-9A-Za-z_.@]+}',
$router->get('otp/start/{address:[0-9A-Za-z_.\-@]+}',
[ 'middleware' => 'basic.auth' , 'uses' => 'UsersController@OTPStart']);
$router->get('otp/start/{address:[0-9A-Za-z_.@]+}/{code:[0-9]{6}}',
$router->get('otp/start/{address:[0-9A-Za-z_.\-@]+}/{code:[0-9]{6}}',
[ 'middleware' => 'basic.auth' , 'uses' => 'UsersController@OTPStart']);
$router->get('otp/confirm/{address:[0-9A-Za-z_.@]+}/{code:[0-9]{6}}',
$router->get('otp/confirm/{address:[0-9A-Za-z_.\-@]+}/{code:[0-9]{6}}',
[ 'middleware' => 'basic.auth' , 'uses' => 'UsersController@OTPConfirm']);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment