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

@@ -107,6 +107,12 @@ const WEBHOOK_COLUMNS = [
type: 'Text',
label: t('Status'),
},
{
id: VirtualId(),
colId: 'authorization',
type: 'Text',
label: t('Header Authorization'),
},
] as const;
/**
@@ -114,10 +120,11 @@ const WEBHOOK_COLUMNS = [
*/
const WEBHOOK_VIEW_FIELDS: Array<(typeof WEBHOOK_COLUMNS)[number]['colId']> = [
'name', 'memo',
'eventTypes', 'url',
'tableId', 'isReadyColumn',
'watchedColIdsText', 'webhookId',
'enabled', 'status'
'eventTypes', 'tableId',
'watchedColIdsText', 'isReadyColumn',
'url', 'authorization',
'webhookId', 'enabled',
'status'
];
/**
@@ -136,7 +143,7 @@ class WebhookExternalTable implements IExternalTable {
public name = 'GristHidden_WebhookTable';
public initialActions = _prepareWebhookInitialActions(this.name);
public saveableFields = [
'tableId', 'watchedColIdsText', 'url', 'eventTypes', 'enabled', 'name', 'memo', 'isReadyColumn',
'tableId', 'watchedColIdsText', 'url', 'authorization', 'eventTypes', 'enabled', 'name', 'memo', 'isReadyColumn',
];
public webhooks: ObservableArray<UIWebhookSummary> = observableArray<UIWebhookSummary>([]);