1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-09 15:55:23 +02:00

feat(webhook) EE-2125 send registry auth haeder when update swarms service via webhook (#6220)

* feat(webhook) EE-2125 add some helpers to registry utils

* feat(webhook) EE-2125 persist registryID when creating a webhook

* feat(webhook) EE-2125 send registry auth header when executing a webhook

* feat(webhook) EE-2125 send registryID to backend when creating a service with webhook

* feat(webhook) EE-2125 use the initial registry ID to create webhook on editing service screen

* feat(webhook) EE-2125 update webhook when update registry

* feat(webhook) EE-2125 add endpoint of update webhook

* feat(webhook) EE-2125 code cleanup

* feat(webhook) EE-2125 fix a typo

* feat(webhook) EE-2125 fix circle import issue with unit test

Co-authored-by: Simon Meng <simon.meng@portainer.io>
This commit is contained in:
cong meng 2021-12-07 09:11:44 +13:00 committed by GitHub
parent aa8fc52106
commit 98972dec0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 254 additions and 8 deletions

View file

@ -9,6 +9,7 @@ angular.module('portainer.app').factory('Webhooks', [
{
query: { method: 'GET', isArray: true },
create: { method: 'POST' },
update: { method: 'PUT', params: { id: '@id' } },
remove: { method: 'DELETE', params: { id: '@id' } },
}
);

View file

@ -25,8 +25,12 @@ angular.module('portainer.app').factory('WebhookService', [
return deferred.promise;
};
service.createServiceWebhook = function (serviceID, endpointID) {
return Webhooks.create({ ResourceID: serviceID, EndpointID: endpointID, WebhookType: 1 }).$promise;
service.createServiceWebhook = function (serviceID, endpointID, registryID) {
return Webhooks.create({ ResourceID: serviceID, EndpointID: endpointID, WebhookType: 1, registryID }).$promise;
};
service.updateServiceWebhook = function (id, registryID) {
return Webhooks.update({ id, registryID }).$promise;
};
service.deleteWebhook = function (id) {