mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-24 03:20:33 +02:00
Added domains page
- Added api security fixes - GUI updates
This commit is contained in:
parent
dd893c2822
commit
54fb9c26f2
12 changed files with 62 additions and 29 deletions
|
@ -62,6 +62,17 @@ $app->any('/api[/{params:.*}]', function (
|
|||
'password' => $db['mysql']['password'],
|
||||
'database' => $db['mysql']['database'],
|
||||
'basePath' => '/api',
|
||||
'middlewares' => 'authorization,sanitation',
|
||||
'authorization.tableHandler' => function ($operation, $tableName) {
|
||||
$restrictedTables = ['users', 'contact_authInfo', 'contact_postalInfo', 'domain_authInfo', 'secdns'];
|
||||
return !in_array($tableName, $restrictedTables);
|
||||
},
|
||||
'authorization.columnHandler' => function ($operation, $tableName, $columnName) {
|
||||
return !($tableName == 'registrar' && $columnName == 'pw');
|
||||
},
|
||||
'sanitation.handler' => function ($operation, $tableName, $column, $value) {
|
||||
return is_string($value) ? strip_tags($value) : $value;
|
||||
},
|
||||
]);
|
||||
$api = new Api($config);
|
||||
$response = $api->handle($request);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue