18 Commits

Author SHA1 Message Date
rijkvanzanten
02747d9afc Fixed typo 2022-03-11 10:23:59 -05:00
Dominic Marcelino
625c89f74c Update hooks.md - add system collection "files", fix payload parameter (#12094)
* Update hooks.md

* Delete event does not contains the whole payload but the payload keys
* files filter and hooks exist except for create/update

* Update docs/extensions/hooks.md

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-03-11 09:50:25 -05:00
Rijk van Zanten
eec21d8d9a Add "items.sort" event (#11954)
* Adds the 'sort_updated' event emit after items are sorted

Signed-off-by: Mihovil Ilakovac <mihovil.ilakovac@gmail.com>

* Updates the event name to 'sort_update'. Docs.

Signed-off-by: Mihovil Ilakovac <mihovil.ilakovac@gmail.com>

* Updates the event name to `sort`

* Add item/to to hook, fix docs

Co-authored-by: Mihovil Ilakovac <mihovil.ilakovac@gmail.com>
2022-03-04 19:58:47 -05:00
Rijk van Zanten
eea9f45624 Add authenticate hook to implement custom auth checks against current request (#11942)
* Add "authenticate" filter hook that allows custom auth check

* Start on test

* Update Jest, restructure API tests, start implementing authenticate test

* Move access token verify to util function

* Ensure jest can show inline warnings on correct lines

* Update is-directus-jwt to use jsonwebtoken decode + add tests

* Remove unused package

* Tweak and finish + test authenticate

* Tweak test

* Add authenticate filter to docs

* Don't scan tests for codeql

* No seriously, ignore tests
2022-03-03 16:29:13 -05:00
Brainslug
35c3f90c9a added event emitter to extension context and updated docs (#10529) 2021-12-15 21:29:06 +00:00
Nicola Krumschmidt
90b59d89e0 Extension docs updates (#8611)
* Rename API Endpoints docs to Endpoints to align with Hooks

* Add a Creating Extensions page to the docs

* Update individual extension docs pages

* Apply latest changes to hook docs

* Move available events to a dedicated section in hook docs
2021-12-06 13:08:31 -05:00
Azri Kahar
19cbe896b4 docs updates on file library, content sidebar etc (#10334) 2021-12-06 09:36:00 -05:00
Oreille
e03bb391b0 Add items.read filter hook (#10279) 2021-12-03 16:37:04 +00:00
Jay Cammarano
57494d8cca removed security hole (#10174) 2021-11-30 21:28:33 +00:00
Jay Cammarano
2e821f1b2c Reorganize the Hooks Documentation (#10033)
* reorganized hooks

* clean up text

* reordered performance warning

* create a hook rework

* spelling
2021-11-24 17:12:29 -05:00
José Varela
ca19cb1a99 emit auth.jwt on refresh (#9661) 2021-11-09 14:01:38 -05:00
gkielwasser
053d2a6a37 Expose server instance in action hook 'server.start' (#9616)
* Expose server instance in action hook 'server.start'

* Expose server in start/stop

* Update documentation
2021-11-09 16:28:24 +00:00
Tyler Forest-Hauser
3cbd908839 Small fixes for Hooks documentation (#9497)
Remove erroneous closing bracket and remove index position from input as it should be an object in this context, not an array.
2021-11-04 23:16:09 +00:00
Nicola Krumschmidt
7fcebf3768 Clarify hook register function parameter descriptions in docs (#9489)
* Clarify hook register function parameter descriptions in docs

* Update package-lock.json

* Update docs/extensions/hooks.md

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2021-11-04 17:03:15 -04:00
Nicola Krumschmidt
3d0e086c55 Rework hook registration (#8027)
* Rework hook registration

* Remove event and action fields from hook payloads

* Move "error" action to "request.error" filter

* Emit meta and context objects in filters and actions

* Run filters sequentially

* Update hook templates

* Fix CLI hook test

* Also emit `<collection>.items.crud` when emitting `items.crud`.

* Update hook docs

Co-authored-by: Oreilles <oreilles.github@nitoref.io>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-11-03 17:18:56 -04:00
Aiden Foxx
b6cb3253f6 Added the provider to auth hooks (#9059)
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-10-26 15:36:08 -04:00
Rijk van Zanten
cfe9d0ffb9 Re-add missing oauth docs (#9170) 2021-10-26 14:17:15 -04:00
Ben Haynes
1b87e4555f Docs structure (#9071)
* WIP

* updates

* docs updates

* structure

* big structure update

* docs module icon change

* in-app docs nav

* more content and structure changes

* Remove redundant

* Fix docs build in app

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-10-25 21:19:23 -04:00