Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for webhook listeners #45475

Merged
merged 32 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8d18607
feat: Add support for webhook listeners
come-nc May 23, 2024
d835d23
feat: Serialize event data and author userid to webhook
come-nc May 23, 2024
aa974a4
feat: Add webhooks application
come-nc May 28, 2024
cf26559
Revert "feat: Serialize event data and author userid to webhook"
come-nc May 30, 2024
c3d4d2a
Revert "feat: Add support for webhook listeners"
come-nc May 30, 2024
734aad8
feat: Make node events serializable
come-nc May 30, 2024
3b64e52
feat: Add command to list registered webhooks
come-nc May 30, 2024
5dd9c2f
feat: Add admin delegation for webhooks
come-nc May 30, 2024
144bdd7
feat: Add event filtering to webhooks
come-nc May 30, 2024
7fe3f1c
fix: Add event filter to openapi
come-nc May 30, 2024
75b2ed4
chore: Add tests for the PHPMongoQuery class
come-nc Jun 3, 2024
261f08e
feat: Add app_api app id to saved information about webhook
come-nc Jun 3, 2024
85e0407
feat: Add support for headers and authentication headers in webhooks
come-nc Jun 3, 2024
8aae03c
fix: Fix TODOs about authentication data, list possible auth methods
come-nc Jun 4, 2024
d3c06d5
fix: Fix eventFilter definition in ResponseDefinitions
come-nc Jun 4, 2024
cccda66
fix: Fix errors spotted by reviewers, fix `@throws` annotations
come-nc Jun 6, 2024
35d5d90
chore: rename Index.php to ListWebhooks.php
come-nc Jun 6, 2024
e111d2e
fix: Make webhook event serialization opt-in with a new interface
come-nc Jun 6, 2024
98f3ea6
fix: Cache webhooks listened events for 5min
come-nc Jun 6, 2024
3bc43b2
fix: Move caching to the mapper instead
come-nc Jun 6, 2024
bb2cb45
fix: Remove superfluous antislash from event name to avoid problems
come-nc Jun 10, 2024
621c068
fix(webhooks): fix crash when headers is null with header auth method
come-nc Jun 10, 2024
74e5812
fix(webhooks): Refuse webhooks registration if auth header is used wi…
come-nc Jun 10, 2024
6c7931b
fix(webhooks): Add Nextcloud certificate bundle to client options
come-nc Jun 10, 2024
c940ba0
fix(webhooks): Fix migration uri length
come-nc Jun 10, 2024
6e38b48
feat(webhooks): Add \SensitiveValue attribute to authData parameter i…
come-nc Jun 10, 2024
9449f64
fix(webhooks): Fix tests
come-nc Jun 10, 2024
19bc3ed
chore(webhooks): Rename webhooks application to webhook_listeners
come-nc Jun 10, 2024
f09c781
fix(webhooks): Fix a few of psalm errors
come-nc Jun 10, 2024
d5b53be
fix(webhooks): Fix openapi reponse definition
come-nc Jun 11, 2024
bff7d3c
fix(webhooks): Fix last psalm and openapi problems with the API
come-nc Jun 11, 2024
e0b9ff4
fix(webhooks): Fix a few more psalm notices
come-nc Jun 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
!/apps/twofactor_backupcodes
!/apps/user_status
!/apps/weather_status
!/apps/webhook_listeners
!/apps/workflowengine
/apps/files_external/3rdparty/irodsphp/PHPUnitTest
/apps/files_external/3rdparty/irodsphp/web
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ class ComposerStaticInitDAV
'OCA\\DAV\\CardDAV\\MultiGetExportPlugin' => __DIR__ . '/..' . '/../lib/CardDAV/MultiGetExportPlugin.php',
'OCA\\DAV\\CardDAV\\PhotoCache' => __DIR__ . '/..' . '/../lib/CardDAV/PhotoCache.php',
'OCA\\DAV\\CardDAV\\Plugin' => __DIR__ . '/..' . '/../lib/CardDAV/Plugin.php',
'OCA\\DAV\\CardDAV\\Security\\CardDavRateLimitingPlugin' => __DIR__ . '/..' . '/../lib/CardDAV/Security/CardDavRateLimitingPlugin.php',
'OCA\\DAV\\CardDAV\\Sharing\\Backend' => __DIR__ . '/..' . '/../lib/CardDAV/Sharing/Backend.php',
'OCA\\DAV\\CardDAV\\Sharing\\Service' => __DIR__ . '/..' . '/../lib/CardDAV/Sharing/Service.php',
'OCA\\DAV\\CardDAV\\SyncService' => __DIR__ . '/..' . '/../lib/CardDAV/SyncService.php',
'OCA\\DAV\\CardDAV\\SystemAddressbook' => __DIR__ . '/..' . '/../lib/CardDAV/SystemAddressbook.php',
'OCA\\DAV\\CardDAV\\UserAddressBooks' => __DIR__ . '/..' . '/../lib/CardDAV/UserAddressBooks.php',
'OCA\\DAV\\CardDAV\\Xml\\Groups' => __DIR__ . '/..' . '/../lib/CardDAV/Xml/Groups.php',
'OCA\\DAV\\CardDAV\\Security\\CardDavRateLimitingPlugin' => __DIR__ . '/..' . '/../lib/CardDAV/Security/CardDavRateLimitingPlugin.php',
'OCA\\DAV\\Command\\CreateAddressBook' => __DIR__ . '/..' . '/../lib/Command/CreateAddressBook.php',
'OCA\\DAV\\Command\\CreateCalendar' => __DIR__ . '/..' . '/../lib/Command/CreateCalendar.php',
'OCA\\DAV\\Command\\DeleteCalendar' => __DIR__ . '/..' . '/../lib/Command/DeleteCalendar.php',
Expand Down
33 changes: 33 additions & 0 deletions apps/webhook_listeners/appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0"?>
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>webhook_listeners</id>
<name>Nextcloud webhook support</name>
<summary>Nextcloud webhook support</summary>
<description>Nextcloud webhook support</description>
<version>1.0.0-dev</version>
<licence>agpl</licence>
<author>Côme Chilliet</author>
<namespace>WebhookListeners</namespace>

<types>
<filesystem/>
</types>

<category>customization</category>
<website>https://github.com/nextcloud/server</website>
<bugs>https://github.com/nextcloud/server/issues</bugs>
<repository>https://github.com/nextcloud/server.git</repository>

<dependencies>
<nextcloud min-version="30" max-version="30"/>
</dependencies>

<commands>
<command>OCA\WebhookListeners\Command\ListWebhooks</command>
</commands>

<settings>
<admin>OCA\WebhookListeners\Settings\Admin</admin>
</settings>
</info>
25 changes: 25 additions & 0 deletions apps/webhook_listeners/composer/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitWebhookListeners::getLoader();
13 changes: 13 additions & 0 deletions apps/webhook_listeners/composer/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"config" : {
"vendor-dir": ".",
"optimize-autoloader": true,
"classmap-authoritative": true,
"autoloader-suffix": "WebhookListeners"
},
"autoload" : {
"psr-4": {
"OCA\\WebhookListeners\\": "../lib/"
}
}
}
18 changes: 18 additions & 0 deletions apps/webhook_listeners/composer/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading