@@ -99,7 +99,7 @@ The following features are supported:
9999 - Supports a JSON array as input (batch insert)
100100 - Sanitize and validate input using callbacks
101101 - Permission system for databases, tables, columns and records
102- - Multi-tenant database layouts are supported
102+ - Multi-tenant single and multi database layouts are supported
103103 - Multi-domain CORS support for cross-domain requests
104104 - Support for reading joined results from multiple tables
105105 - Search support on multiple criteria
@@ -110,6 +110,7 @@ The following features are supported:
110110 - Spatial/GIS fields and filters supported with WKT and GeoJSON
111111 - Generate API documentation using OpenAPI tools
112112 - Authentication via JWT token or username/password
113+ - Database connection parameters may depend on authentication
113114 - Support for reading database structure in JSON
114115 - Support for modifying database structure using REST endpoint
115116 - Security enhancing middleware is included
@@ -137,84 +138,6 @@ This script will install and run [Composer](https://getcomposer.org/) to update
137138
138139NB: The update script will also patch the dependencies in the vendor directory for PHP 7.0 compatibility.
139140
140- ## Middleware
141-
142- You can enable the following middleware using the "middlewares" config parameter:
143-
144- - "firewall": Limit access to specific IP addresses
145- - "cors": Support for CORS requests (enabled by default)
146- - "xsrf": Block XSRF attacks using the 'Double Submit Cookie' method
147- - "ajaxOnly": Restrict non-AJAX requests to prevent XSRF attacks
148- - "dbAuth": Support for "Database Authentication"
149- - "jwtAuth": Support for "JWT Authentication"
150- - "basicAuth": Support for "Basic Authentication"
151- - "reconnect": Reconnect to the database with different parameters
152- - "authorization": Restrict access to certain tables or columns
153- - "validation": Return input validation errors for custom rules
154- - "ipAddress": Fill a protected field with the IP address on create
155- - "sanitation": Apply input sanitation on create and update
156- - "multiTenancy": Restricts tenants access in a multi-tenant scenario
157- - "pageLimits": Restricts list operations to prevent database scraping
158- - "joinLimits": Restricts join parameters to prevent database scraping
159- - "customization": Provides handlers for request and response customization
160-
161- The "middlewares" config parameter is a comma separated list of enabled middlewares.
162- You can tune the middleware behavior using middleware specific configuration parameters:
163-
164- - "firewall.reverseProxy": Set to "true" when a reverse proxy is used ("")
165- - "firewall.allowedIpAddresses": List of IP addresses that are allowed to connect ("")
166- - "cors.allowedOrigins": The origins allowed in the CORS headers ("* ")
167- - "cors.allowHeaders": The headers allowed in the CORS request ("Content-Type, X-XSRF-TOKEN")
168- - "cors.allowMethods": The methods allowed in the CORS request ("OPTIONS, GET, PUT, POST, DELETE, PATCH")
169- - "cors.allowCredentials": To allow credentials in the CORS request ("true")
170- - "cors.exposeHeaders": Whitelist headers that browsers are allowed to access ("")
171- - "cors.maxAge": The time that the CORS grant is valid in seconds ("1728000")
172- - "xsrf.excludeMethods": The methods that do not require XSRF protection ("OPTIONS,GET")
173- - "xsrf.cookieName": The name of the XSRF protection cookie ("XSRF-TOKEN")
174- - "xsrf.headerName": The name of the XSRF protection header ("X-XSRF-TOKEN")
175- - "ajaxOnly.excludeMethods": The methods that do not require AJAX ("OPTIONS,GET")
176- - "ajaxOnly.headerName": The name of the required header ("X-Requested-With")
177- - "ajaxOnly.headerValue": The value of the required header ("XMLHttpRequest")
178- - "dbAuth.mode": Set to "optional" if you want to allow anonymous access ("required")
179- - "dbAuth.usersTable": The table that is used to store the users in ("users")
180- - "dbAuth.usernameColumn": The users table column that holds usernames ("username")
181- - "dbAuth.passwordColumn": The users table column that holds passwords ("password")
182- - "dbAuth.returnedColumns": The columns returned on successful login, empty means 'all' ("")
183- - "jwtAuth.mode": Set to "optional" if you want to allow anonymous access ("required")
184- - "jwtAuth.header": Name of the header containing the JWT token ("X-Authorization")
185- - "jwtAuth.leeway": The acceptable number of seconds of clock skew ("5")
186- - "jwtAuth.ttl": The number of seconds the token is valid ("30")
187- - "jwtAuth.secret": The shared secret used to sign the JWT token with ("")
188- - "jwtAuth.algorithms": The algorithms that are allowed, empty means 'all' ("")
189- - "jwtAuth.audiences": The audiences that are allowed, empty means 'all' ("")
190- - "jwtAuth.issuers": The issuers that are allowed, empty means 'all' ("")
191- - "basicAuth.mode": Set to "optional" if you want to allow anonymous access ("required")
192- - "basicAuth.realm": Text to prompt when showing login ("Username and password required")
193- - "basicAuth.passwordFile": The file to read for username/password combinations (".htpasswd")
194- - "reconnect.driverHandler": Handler to implement retrieval of the database driver ("")
195- - "reconnect.addressHandler": Handler to implement retrieval of the database address ("")
196- - "reconnect.portHandler": Handler to implement retrieval of the database port ("")
197- - "reconnect.databaseHandler": Handler to implement retrieval of the database name ("")
198- - "reconnect.usernameHandler": Handler to implement retrieval of the database username ("")
199- - "reconnect.passwordHandler": Handler to implement retrieval of the database password ("")
200- - "authorization.tableHandler": Handler to implement table authorization rules ("")
201- - "authorization.columnHandler": Handler to implement column authorization rules ("")
202- - "authorization.recordHandler": Handler to implement record authorization filter rules ("")
203- - "validation.handler": Handler to implement validation rules for input values ("")
204- - "ipAddress.tables": Tables to search for columns to override with IP address ("")
205- - "ipAddress.columns": Columns to protect and override with the IP address on create ("")
206- - "sanitation.handler": Handler to implement sanitation rules for input values ("")
207- - "multiTenancy.handler": Handler to implement simple multi-tenancy rules ("")
208- - "pageLimits.pages": The maximum page number that a list operation allows ("100")
209- - "pageLimits.records": The maximum number of records returned by a list operation ("1000")
210- - "joinLimits.depth": The maximum depth (length) that is allowed in a join path ("3")
211- - "joinLimits.tables": The maximum number of tables that you are allowed to join ("10")
212- - "joinLimits.records": The maximum number of records returned for a joined entity ("1000")
213- - "customization.beforeHandler": Handler to implement request customization ("")
214- - "customization.afterHandler": Handler to implement response customization ("")
215-
216- If you don't specify these parameters in the configuration, then the default values (between brackets) are used.
217-
218141## TreeQL, a pragmatic GraphQL
219142
220143[ TreeQL] ( https://treeql.org ) allows you to create a "tree" of JSON objects based on your SQL database structure (relations) and your query.
@@ -646,6 +569,86 @@ The following Geometry types are supported by the GeoJSON implementation:
646569
647570The GeoJSON functionality is enabled by default, but can be disabled using the "controllers" configuration.
648571
572+ ## Middleware
573+
574+ You can enable the following middleware using the "middlewares" config parameter:
575+
576+ - "firewall": Limit access to specific IP addresses
577+ - "cors": Support for CORS requests (enabled by default)
578+ - "xsrf": Block XSRF attacks using the 'Double Submit Cookie' method
579+ - "ajaxOnly": Restrict non-AJAX requests to prevent XSRF attacks
580+ - "dbAuth": Support for "Database Authentication"
581+ - "jwtAuth": Support for "JWT Authentication"
582+ - "basicAuth": Support for "Basic Authentication"
583+ - "reconnect": Reconnect to the database with different parameters
584+ - "authorization": Restrict access to certain tables or columns
585+ - "validation": Return input validation errors for custom rules
586+ - "ipAddress": Fill a protected field with the IP address on create
587+ - "sanitation": Apply input sanitation on create and update
588+ - "multiTenancy": Restricts tenants access in a multi-tenant scenario
589+ - "pageLimits": Restricts list operations to prevent database scraping
590+ - "joinLimits": Restricts join parameters to prevent database scraping
591+ - "customization": Provides handlers for request and response customization
592+
593+ The "middlewares" config parameter is a comma separated list of enabled middlewares.
594+ You can tune the middleware behavior using middleware specific configuration parameters:
595+
596+ - "firewall.reverseProxy": Set to "true" when a reverse proxy is used ("")
597+ - "firewall.allowedIpAddresses": List of IP addresses that are allowed to connect ("")
598+ - "cors.allowedOrigins": The origins allowed in the CORS headers ("* ")
599+ - "cors.allowHeaders": The headers allowed in the CORS request ("Content-Type, X-XSRF-TOKEN")
600+ - "cors.allowMethods": The methods allowed in the CORS request ("OPTIONS, GET, PUT, POST, DELETE, PATCH")
601+ - "cors.allowCredentials": To allow credentials in the CORS request ("true")
602+ - "cors.exposeHeaders": Whitelist headers that browsers are allowed to access ("")
603+ - "cors.maxAge": The time that the CORS grant is valid in seconds ("1728000")
604+ - "xsrf.excludeMethods": The methods that do not require XSRF protection ("OPTIONS,GET")
605+ - "xsrf.cookieName": The name of the XSRF protection cookie ("XSRF-TOKEN")
606+ - "xsrf.headerName": The name of the XSRF protection header ("X-XSRF-TOKEN")
607+ - "ajaxOnly.excludeMethods": The methods that do not require AJAX ("OPTIONS,GET")
608+ - "ajaxOnly.headerName": The name of the required header ("X-Requested-With")
609+ - "ajaxOnly.headerValue": The value of the required header ("XMLHttpRequest")
610+ - "dbAuth.mode": Set to "optional" if you want to allow anonymous access ("required")
611+ - "dbAuth.usersTable": The table that is used to store the users in ("users")
612+ - "dbAuth.usernameColumn": The users table column that holds usernames ("username")
613+ - "dbAuth.passwordColumn": The users table column that holds passwords ("password")
614+ - "dbAuth.returnedColumns": The columns returned on successful login, empty means 'all' ("")
615+ - "jwtAuth.mode": Set to "optional" if you want to allow anonymous access ("required")
616+ - "jwtAuth.header": Name of the header containing the JWT token ("X-Authorization")
617+ - "jwtAuth.leeway": The acceptable number of seconds of clock skew ("5")
618+ - "jwtAuth.ttl": The number of seconds the token is valid ("30")
619+ - "jwtAuth.secret": The shared secret used to sign the JWT token with ("")
620+ - "jwtAuth.algorithms": The algorithms that are allowed, empty means 'all' ("")
621+ - "jwtAuth.audiences": The audiences that are allowed, empty means 'all' ("")
622+ - "jwtAuth.issuers": The issuers that are allowed, empty means 'all' ("")
623+ - "basicAuth.mode": Set to "optional" if you want to allow anonymous access ("required")
624+ - "basicAuth.realm": Text to prompt when showing login ("Username and password required")
625+ - "basicAuth.passwordFile": The file to read for username/password combinations (".htpasswd")
626+ - "reconnect.driverHandler": Handler to implement retrieval of the database driver ("")
627+ - "reconnect.addressHandler": Handler to implement retrieval of the database address ("")
628+ - "reconnect.portHandler": Handler to implement retrieval of the database port ("")
629+ - "reconnect.databaseHandler": Handler to implement retrieval of the database name ("")
630+ - "reconnect.usernameHandler": Handler to implement retrieval of the database username ("")
631+ - "reconnect.passwordHandler": Handler to implement retrieval of the database password ("")
632+ - "authorization.tableHandler": Handler to implement table authorization rules ("")
633+ - "authorization.columnHandler": Handler to implement column authorization rules ("")
634+ - "authorization.recordHandler": Handler to implement record authorization filter rules ("")
635+ - "validation.handler": Handler to implement validation rules for input values ("")
636+ - "ipAddress.tables": Tables to search for columns to override with IP address ("")
637+ - "ipAddress.columns": Columns to protect and override with the IP address on create ("")
638+ - "sanitation.handler": Handler to implement sanitation rules for input values ("")
639+ - "multiTenancy.handler": Handler to implement simple multi-tenancy rules ("")
640+ - "pageLimits.pages": The maximum page number that a list operation allows ("100")
641+ - "pageLimits.records": The maximum number of records returned by a list operation ("1000")
642+ - "joinLimits.depth": The maximum depth (length) that is allowed in a join path ("3")
643+ - "joinLimits.tables": The maximum number of tables that you are allowed to join ("10")
644+ - "joinLimits.records": The maximum number of records returned for a joined entity ("1000")
645+ - "customization.beforeHandler": Handler to implement request customization ("")
646+ - "customization.afterHandler": Handler to implement response customization ("")
647+
648+ If you don't specify these parameters in the configuration, then the default values (between brackets) are used.
649+
650+ In the sections below you find more information on the built-in middleware.
651+
649652### Authentication
650653
651654Currently there are three types of authentication supported. They all store the authenticated user in the ` $_SESSION ` super global.
0 commit comments