Add authorization header in webhooks stored in secrets table (#941)

Summary:
Adding authorization header support for webhooks.

Issue:  https://github.com/gristlabs/grist-core/issues/827

---------

Co-authored-by: Florent <florent.git@zeteo.me>
This commit is contained in:
CamilleLegeron
2024-07-04 14:17:10 +02:00
committed by GitHub
parent 2750ed6bd9
commit 0bfdaa9c02
9 changed files with 91 additions and 21 deletions

View File

@@ -4625,6 +4625,7 @@ function testDocApi() {
id: first.webhookId,
fields: {
url: `${serving.url}/200`,
authorization: '',
unsubscribeKey: first.unsubscribeKey,
eventTypes: ['add', 'update'],
enabled: true,
@@ -4643,6 +4644,7 @@ function testDocApi() {
id: second.webhookId,
fields: {
url: `${serving.url}/404`,
authorization: '',
unsubscribeKey: second.unsubscribeKey,
eventTypes: ['add', 'update'],
enabled: true,
@@ -5010,6 +5012,7 @@ function testDocApi() {
const expectedFields = {
url: `${serving.url}/foo`,
authorization: '',
eventTypes: ['add'],
isReadyColumn: 'B',
tableId: 'Table1',
@@ -5079,6 +5082,8 @@ function testDocApi() {
await check({isReadyColumn: null}, 200);
await check({isReadyColumn: "bar"}, 404, `Column not found "bar"`);
await check({authorization: 'Bearer fake-token'}, 200);
});
});