File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -768,7 +768,7 @@ You can also change the `url` variable, used to test the API with authentication
768
768
769
769
[ More info] ( https://firebase.google.com/docs/auth/admin/verify-id-tokens#verify_id_tokens_using_a_third-party_jwt_library )
770
770
771
- ## Authorizing operations
771
+ ### Authorizing operations
772
772
773
773
The Authorization model acts on "operations". The most important ones are listed here:
774
774
@@ -815,6 +815,23 @@ This construct adds a filter to every executed query.
815
815
816
816
NB: You need to handle the creation of invalid records with a validation (or sanitation) handler.
817
817
818
+ ### SQL GRANT authorization
819
+
820
+ You can alternatively use database permissons (SQL GRANT statements) to define the authorization model. In this case you
821
+ should not use the "authorization" middleware, but you do need to use the "reconnect" middleware. The handlers of the
822
+ "reconnect" middleware allow you to specify the correct username and password, like this:
823
+
824
+ 'reconnect.usernameHandler' => function () {
825
+ return 'mevdschee';
826
+ },
827
+ 'reconnect.passwordHandler' => function () {
828
+ return 'secret123';
829
+ },
830
+
831
+ This will make the API connect to the database specifying "mevdschee" as the username and "secret123" as the password.
832
+
833
+ NB: You may want to retrieve the username and password from the session (the "$_ SESSION" variable).
834
+
818
835
### Sanitizing input
819
836
820
837
By default all input is accepted and sent to the database. If you want to strip (certain) HTML tags before storing you may add
You can’t perform that action at this time.
0 commit comments