|
@@ -149,7 +149,7 @@ You can enable the following middleware using the "middlewares" config parameter
|
149
|
149
|
- "validation": Return input validation errors for custom rules
|
150
|
150
|
- "sanitation": Apply input sanitation on create and update
|
151
|
151
|
- "multiTenancy": Restricts tenants access in a multi-tenant scenario
|
152
|
|
-- "custom": Provides handlers for request and response customization
|
|
152
|
+- "customization": Provides handlers for request and response customization
|
153
|
153
|
|
154
|
154
|
The "middlewares" config parameter is a comma separated list of enabled middlewares.
|
155
|
155
|
You can tune the middleware behavior using middleware specific configuration parameters:
|
|
@@ -171,8 +171,8 @@ You can tune the middleware behavior using middleware specific configuration par
|
171
|
171
|
- "validation.handler": Handler to implement validation rules for input values ("")
|
172
|
172
|
- "sanitation.handler": Handler to implement sanitation rules for input values ("")
|
173
|
173
|
- "multiTenancy.handler": Handler to implement simple multi-tenancy rules ("")
|
174
|
|
-- "custom.beforeHandler": Handler to implement request customization ("")
|
175
|
|
-- "custom.afterHandler": Handler to implement response customization ("")
|
|
174
|
+- "customization.beforeHandler": Handler to implement request customization ("")
|
|
175
|
+- "customization.afterHandler": Handler to implement response customization ("")
|
176
|
176
|
|
177
|
177
|
If you don't specify these parameters in the configuration, then the default values (between brackets) are used.
|
178
|
178
|
|
|
@@ -698,14 +698,14 @@ If your tenants are identified by the "customer_id" column you can use the follo
|
698
|
698
|
This construct adds a filter requiring "customer_id" to be "12" to every operation (except for "create").
|
699
|
699
|
It also sets the column "customer_id" on "create" to "12" and removes the column from any other write operation.
|
700
|
700
|
|
701
|
|
-### Custom handlers
|
|
701
|
+### Customization handlers
|
702
|
702
|
|
703
|
|
-You may use the "custom" middleware to implement any other functionality.
|
|
703
|
+You may use the "customization" middleware to implement any other functionality.
|
704
|
704
|
|
705
|
|
- 'custom.beforeHandler' => function ($operation, $tableName, $request, $environment) {
|
|
705
|
+ 'customization.beforeHandler' => function ($operation, $tableName, $request, $environment) {
|
706
|
706
|
$environment->start = microtime(true);
|
707
|
707
|
},
|
708
|
|
- 'custom.afterHandler' => function ($operation, $tableName, $response, $environment) {
|
|
708
|
+ 'customization.afterHandler' => function ($operation, $tableName, $response, $environment) {
|
709
|
709
|
$response->addHeader('X-Time-Taken', microtime(true) - $environment->start);
|
710
|
710
|
},
|
711
|
711
|
|