Merge commit '1392bd3a96045302b60d845a90901a4b2234c475' as 'seatmap-webapi'
This commit is contained in:
61
seatmap-webapi/tests/config/base.php
Normal file
61
seatmap-webapi/tests/config/base.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
$settings = [
|
||||
'database' => 'incorrect_database',
|
||||
'username' => 'incorrect_username',
|
||||
'password' => 'incorrect_password',
|
||||
'controllers' => 'records,columns,cache,openapi,geojson',
|
||||
'middlewares' => 'sslRedirect,xml,cors,reconnect,dbAuth,jwtAuth,basicAuth,authorization,sanitation,validation,ipAddress,multiTenancy,pageLimits,joinLimits,customization',
|
||||
'dbAuth.mode' => 'optional',
|
||||
'dbAuth.returnedColumns' => 'id,username,password',
|
||||
'dbAuth.registerUser' => '1',
|
||||
'dbAuth.passwordLength' => '4',
|
||||
'jwtAuth.mode' => 'optional',
|
||||
'jwtAuth.time' => '1538207605',
|
||||
'jwtAuth.secrets' => 'axpIrCGNGqxzx2R9dtXLIPUSqPo778uhb8CA0F4Hx',
|
||||
'basicAuth.mode' => 'optional',
|
||||
'basicAuth.passwordFile' => __DIR__ . DIRECTORY_SEPARATOR . '.htpasswd',
|
||||
'reconnect.databaseHandler' => function () {
|
||||
return 'php-crud-api';
|
||||
},
|
||||
'reconnect.usernameHandler' => function () {
|
||||
return 'php-crud-api';
|
||||
},
|
||||
'reconnect.passwordHandler' => function () {
|
||||
return 'php-crud-api';
|
||||
},
|
||||
'authorization.tableHandler' => function ($operation, $tableName) {
|
||||
return !($tableName == 'invisibles' && !isset($_SESSION['claims']['name']) && empty($_SESSION['username']) && empty($_SESSION['user']));
|
||||
},
|
||||
'authorization.columnHandler' => function ($operation, $tableName, $columnName) {
|
||||
return !($columnName == 'invisible');
|
||||
},
|
||||
'authorization.recordHandler' => function ($operation, $tableName) {
|
||||
return ($tableName == 'comments') ? 'filter=message,neq,invisible' : '';
|
||||
},
|
||||
'ipAddress.tables' => 'barcodes',
|
||||
'ipAddress.columns' => 'ip_address',
|
||||
'sanitation.handler' => function ($operation, $tableName, $column, $value) {
|
||||
return is_string($value) ? strip_tags($value) : $value;
|
||||
},
|
||||
'sanitation.tables' => 'forgiving',
|
||||
'validation.handler' => function ($operation, $tableName, $column, $value, $context) {
|
||||
return ($column['name'] == 'post_id' && !is_numeric($value)) ? 'must be numeric' : true;
|
||||
},
|
||||
'multiTenancy.handler' => function ($operation, $tableName) {
|
||||
return ($tableName == 'kunsthåndværk') ? ['user_id' => 1] : [];
|
||||
},
|
||||
'pageLimits.pages' => 5,
|
||||
'pageLimits.records' => 10,
|
||||
'joinLimits.depth' => 2,
|
||||
'joinLimits.tables' => 4,
|
||||
'joinLimits.records' => 10,
|
||||
'customization.beforeHandler' => function ($operation, $tableName, $request, $environment) {
|
||||
$environment->start = 0.003/*microtime(true)*/;
|
||||
},
|
||||
'customization.afterHandler' => function ($operation, $tableName, $response, $environment) {
|
||||
if ($tableName == 'kunsthåndværk' && $operation == 'increment') {
|
||||
return $response->withHeader('X-Time-Taken', 0.006/*microtime(true)*/ - $environment->start);
|
||||
}
|
||||
},
|
||||
'debug' => false,
|
||||
];
|
||||
Reference in New Issue
Block a user