From da4320977147fd8351f9e67860d538a02ab75d82 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 10 Aug 2020 14:22:18 +0200 Subject: [PATCH] Document existing events * LoadAdditionalScripts (@rullzer) - https://github.com/nextcloud/server/pull/16641 * LoadViewerEvent (@skjnldsv) - https://github.com/nextcloud/viewer/pull/271 * RegisterDirectEditorEvent (@juliushaertl) - https://github.com/nextcloud/server/pull/17625 * typed events for files scanner (@christophwurst) - https://github.com/nextcloud/server/pull/18351 * typed events for group mangement (@christophwurst) - https://github.com/nextcloud/server/pull/18350 * AddContentSecurityPolicyEvent (@rullzer) - https://github.com/nextcloud/server/pull/15730 * UserLiveStatusEvent (@georgehrke) - https://github.com/nextcloud/server/pull/21186 * password_policy events (@christophwurst) - https://github.com/nextcloud/server/pull/18019 * AddFeaturePolicyEvent (@rullzer) - https://github.com/nextcloud/server/pull/16613 * ShareCreatedEvent (@rullzer) - https://github.com/nextcloud/server/pull/18384 * LoadSettingsScriptsEvent (@blizzz) - https://github.com/nextcloud/server/pull/21475 * flow events (@rullzer) - https://github.com/nextcloud/server/pull/18535 Signed-off-by: Morris Jobke --- developer_manual/basics/events.rst | 178 +++++++++++++++++++++++++++-- 1 file changed, 167 insertions(+), 11 deletions(-) diff --git a/developer_manual/basics/events.rst b/developer_manual/basics/events.rst index 5f7f3394aea..9c1c1bdbe5c 100644 --- a/developer_manual/basics/events.rst +++ b/developer_manual/basics/events.rst @@ -168,12 +168,26 @@ Available Events Here you find an overview of the public events that can be consumed in apps. See their source files for more details. ``\OCA\DAV\Events\SabrePluginAuthInitEvent`` -******************************************************** +******************************************** *Available in Nextcloud 20 and later.* This event is triggered during the setup of the SabreDAV server to allow the registration of additional authentication backends. +``\OCA\FederatedFileSharing\Events\FederatedShareAddedEvent`` +************************************************************* + +*Available in Nextcloud 20 and later.* + +This event is triggered when a federated share is successfully added. + +``\OCA\Files\Event\LoadAdditionalScriptsEvent`` +*********************************************** + +*Available in Nextcloud 17 and later.* + +This event is triggered when the files app is rendered. It canb e used to add additional scripts to the files app. + ``\OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent`` ******************************************************** @@ -181,6 +195,13 @@ This event is triggered during the setup of the SabreDAV server to allow the reg Emitted before the rendering step of the public share page happens. The event holds a flag that specifies if it is the authentication page of a public share. +``\OCA\Viewer\Event\LoadViewer`` +******************************** + +*Available in Nextcloud 17 and later.* + +This event is triggered whenever the viewer is loaded and extensions should be loaded. + ``\OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent`` ************************************************************* @@ -202,6 +223,91 @@ Emitted when the authentication fails, but only if the login name can be associa Event emitted by apps whenever there was an interaction with another user or contact. +It is an event that allows apps to notify other components about an interaction between two users. This can be used to build better recommendations and suggestions in user interfaces. + +Emitters should add at least one identifier (uid, email, federated cloud ID) of the recipient of the interaction. + +``\OCP\DirectEditing\RegisterDirectEditorEvent`` +************************************************ + +*Available in Nextcloud 18 and later.* + +Event to allow to register the direct editor. + +``\OCP\Files\Events\BeforeFileScannedEvent`` +******************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\Files\Events\BeforeFolderScannedEvent`` +********************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\Files\Events\FileCacheUpdated`` +************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\Files\Events\FileScannedEvent`` +************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\Files\Events\FolderScannedEvent`` +**************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\Files\Events\NodeAddedToCache`` +************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\Files\Events\NodeRemovedFromCache`` +****************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\Group\Events\BeforeGroupCreatedEvent`` +********************************************* + +*Available in Nextcloud 18 and later.* + +``\OCP\Group\Events\BeforeGroupDeletedEvent`` +********************************************* + +*Available in Nextcloud 18 and later.* + +``\OCP\Group\Events\BeforeUserAddedEvent`` +****************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\Group\Events\BeforeUserRemovedEvent`` +******************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\Group\Events\GroupCreatedEvent`` +*************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\Group\Events\GroupDeletedEvent`` +*************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\Group\Events\UserAddedEvent`` +************************************ + +*Available in Nextcloud 18 and later.* + +``\OCP\Group\Events\UserRemovedEvent`` +************************************** + +*Available in Nextcloud 18 and later.* ``\OCP\Mail\Events\BeforeMessageSent`` ************************************** @@ -209,6 +315,37 @@ Event emitted by apps whenever there was an interaction with another user or con Emitted before a system mail is sent. It can be used to alter the message. +``\OCP\Security\CSP\AddContentSecurityPolicyEvent`` +*************************************************** + +*Available in Nextcloud 17 and later.* + +Allows to inject something into the default content policy. This is for example useful when you're injecting Javascript code into a view belonging to another controller and cannot modify its Content-Security-Policy itself. Note that the adjustment is only applied to applications that use AppFramework controllers. + +WARNING: Using this API incorrectly may make the instance more insecure. Do think twice before adding whitelisting resources. Please do also note that it is not possible to use the `disallowXYZ` functions. + +``\OCP\Security\Events\GenerateSecurePasswordEvent`` +**************************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\Security\Events\ValidatePasswordPolicyEvent`` +**************************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\Security\FeaturePolicy\AddFeaturePolicyEvent`` +**************************************************** + +*Available in Nextcloud 17 and later.* + +Event that allows to register a feature policy header to a request. + +``\OCP\Share\Events\ShareCreatedEvent`` +******************************************* + +*Available in Nextcloud 18 and later.* + ``\OCP\Share\Events\VerifyMountPointEvent`` ******************************************* @@ -224,10 +361,10 @@ Emitted before a user is logged in via remember-me cookies. ``\OCP\User\Events\UserLoggedInWithCookieEvent`` ************************************************ -Emitted when a user has been succesfully logged in via remember-me cookies. - *Available in Nextcloud 18 and later.* +Emitted when a user has been succesfully logged in via remember-me cookies. + ``\OCP\User\Events\BeforePasswordUpdatedEvent`` *********************************************** @@ -261,15 +398,11 @@ Emitted when a new user has been created on the back-end. *Available in Nextcloud 18 and later.* -Emitted before a user is logged out. - ``\OCP\User\Events\UserDeletedEvent`` ************************************* *Available in Nextcloud 18 and later.* -Emitted when a user has been logged out successfully. - ``\OCP\User\Events\BeforeUserLoggedInEvent`` ******************************************** @@ -280,6 +413,8 @@ Emitted when a user has been logged out successfully. *Available in Nextcloud 18 and later.* +Emitted before a user is logged out. + ``\OCP\User\Events\CreateUserEvent`` ************************************ @@ -295,6 +430,11 @@ Emitted when a user has been logged out successfully. *Available in Nextcloud 18 and later.* +``\OCP\User\Events\UserLiveStatusEvent`` +**************************************** + +*Available in Nextcloud 20 and later.* + ``\OCP\User\Events\UserLoggedInEvent`` ************************************** @@ -305,13 +445,29 @@ Emitted when a user has been logged out successfully. *Available in Nextcloud 18 and later.* -``\OCP\Security\CSP\AddContentSecurityPolicyEvent`` -*************************************************** +Emitted when a user has been logged out successfully. -*Available in Nextcloud 17 and later.* +``\OCP\WorkflowEngine\LoadSettingsScriptsEvent`` +*************************************** + +*Available in Nextcloud 20 and later.* + +Emitted when the workflow engine settings page is loaded. + +``\OCP\WorkflowEngine\RegisterChecksEvent`` +*************************************** -This event is emitted so apps can modify the CSP provided by nextcloud. For example if more domains can be used to connect to. Added in Nextcloud 17. +*Available in Nextcloud 18 and later.* + +``\OCP\WorkflowEngine\RegisterEntitiesEvent`` +*************************************** + +*Available in Nextcloud 18 and later.* + +``\OCP\WorkflowEngine\RegisterOperationsEvent`` +*************************************** +*Available in Nextcloud 18 and later.* Symfony event dispatcher ------------------------