diff --git a/client-templates/bitbucket-server-bearer-auth/accept.json.sample b/client-templates/bitbucket-server-bearer-auth/accept.json.sample index 412ffdcb3..f8468783d 100644 --- a/client-templates/bitbucket-server-bearer-auth/accept.json.sample +++ b/client-templates/bitbucket-server-bearer-auth/accept.json.sample @@ -807,6 +807,26 @@ "token": "${BITBUCKET_PAT}" } }, + { + "//": "allow webhooks to be fetched", + "method": "GET", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + "origin": "https://${BITBUCKET}", + "auth": { + "scheme": "bearer", + "token": "${BITBUCKET_PAT}" + } + }, + { + "//": "allow webhooks to be updated", + "method": "PUT", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + "origin": "https://${BITBUCKET}", + "auth": { + "scheme": "bearer", + "token": "${BITBUCKET_PAT}" + } + }, { "//": "used to create commit status messages", "method": "POST", diff --git a/client-templates/bitbucket-server/accept.json.sample b/client-templates/bitbucket-server/accept.json.sample index 5954c2587..f9e1fe501 100644 --- a/client-templates/bitbucket-server/accept.json.sample +++ b/client-templates/bitbucket-server/accept.json.sample @@ -887,6 +887,28 @@ "password": "${BITBUCKET_PASSWORD}" } }, + { + "//": "allow webhooks to be fetched", + "method": "GET", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + "origin": "https://${BITBUCKET}", + "auth": { + "scheme": "basic", + "username": "${BITBUCKET_USERNAME}", + "password": "${BITBUCKET_PASSWORD}" + } + }, + { + "//": "allow webhooks to be updated", + "method": "PUT", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + "origin": "https://${BITBUCKET}", + "auth": { + "scheme": "basic", + "username": "${BITBUCKET_USERNAME}", + "password": "${BITBUCKET_PASSWORD}" + } + }, { "//": "used to create commit status messages", "method": "POST", diff --git a/client-templates/gitlab/accept.json.sample b/client-templates/gitlab/accept.json.sample index a06829858..6d79e719f 100644 --- a/client-templates/gitlab/accept.json.sample +++ b/client-templates/gitlab/accept.json.sample @@ -1498,6 +1498,18 @@ "path": "/api/v4/projects/:project/hooks/:id", "origin": "https://${GITLAB}" }, + { + "//": "allow webhooks to be updated", + "method": "PUT", + "path": "/api/v4/projects/:project/hooks/:id", + "origin": "https://${GITLAB}" + }, + { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "path": "/api/v4/projects/:project/hooks/:id", + "origin": "https://${GITLAB}" + }, { "//": "used to create commit status messages", "method": "POST", diff --git a/defaultFilters/bitbucket-server-bearer-auth.json b/defaultFilters/bitbucket-server-bearer-auth.json index 412ffdcb3..a22785d4e 100644 --- a/defaultFilters/bitbucket-server-bearer-auth.json +++ b/defaultFilters/bitbucket-server-bearer-auth.json @@ -807,6 +807,26 @@ "token": "${BITBUCKET_PAT}" } }, + { + "//": "allow webhooks to be fetched", + "method": "GET", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + "origin": "https://${BITBUCKET}", + "auth": { + "scheme": "bearer", + "token": "${BITBUCKET_PAT}" + } + }, + { + "//": "allow webhooks to be updated", + "method": "PUT", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + "origin": "https://${BITBUCKET}", + "auth": { + "scheme": "bearer", + "token": "${BITBUCKET_PAT}" + } + }, { "//": "used to create commit status messages", "method": "POST", diff --git a/defaultFilters/bitbucket-server.json b/defaultFilters/bitbucket-server.json index 3e649b091..113578a01 100644 --- a/defaultFilters/bitbucket-server.json +++ b/defaultFilters/bitbucket-server.json @@ -887,6 +887,28 @@ "password": "${BITBUCKET_PASSWORD}" } }, + { + "//": "allow webhooks to be fetched", + "method": "GET", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + "origin": "https://${BITBUCKET}", + "auth": { + "scheme": "basic", + "username": "${BITBUCKET_USERNAME}", + "password": "${BITBUCKET_PASSWORD}" + } + }, + { + "//": "allow webhooks to be updated", + "method": "PUT", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + "origin": "https://${BITBUCKET}", + "auth": { + "scheme": "basic", + "username": "${BITBUCKET_USERNAME}", + "password": "${BITBUCKET_PASSWORD}" + } + }, { "//": "used to create commit status messages", "method": "POST", diff --git a/defaultFilters/gitlab.json b/defaultFilters/gitlab.json index 112859c2a..d230cbe19 100644 --- a/defaultFilters/gitlab.json +++ b/defaultFilters/gitlab.json @@ -1498,6 +1498,18 @@ "path": "/api/v4/projects/:project/hooks/:id", "origin": "https://${GITLAB}" }, + { + "//": "allow webhooks to be updated", + "method": "PUT", + "path": "/api/v4/projects/:project/hooks/:id", + "origin": "https://${GITLAB}" + }, + { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "path": "/api/v4/projects/:project/hooks/:id", + "origin": "https://${GITLAB}" + }, { "//": "used to create commit status messages", "method": "POST", diff --git a/test/unit/__snapshots__/runtime-rules-hotloading.test.ts.snap b/test/unit/__snapshots__/runtime-rules-hotloading.test.ts.snap index 34f7eb6f6..3cb058145 100644 --- a/test/unit/__snapshots__/runtime-rules-hotloading.test.ts.snap +++ b/test/unit/__snapshots__/runtime-rules-hotloading.test.ts.snap @@ -1324,6 +1324,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -2452,6 +2474,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -7819,6 +7861,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -9244,6 +9298,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -10372,6 +10448,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -15739,6 +15835,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -17164,6 +17272,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -18292,6 +18422,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -23659,6 +23809,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -25084,6 +25246,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -26212,6 +26396,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -31579,6 +31783,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -33004,6 +33220,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -34132,6 +34370,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -39499,6 +39757,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -40717,6 +40987,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -41867,6 +42159,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -47207,6 +47519,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -48986,6 +49310,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -50258,6 +50604,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -55879,6 +56245,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -57340,6 +57718,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -58468,6 +58868,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -63847,6 +64267,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -65302,6 +65734,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -66463,6 +66917,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -71896,6 +72370,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -73373,6 +73859,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -74556,6 +75064,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -80033,6 +80561,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -81518,6 +82058,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -82679,6 +83241,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -88112,6 +88694,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -90040,6 +90634,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -91358,6 +91974,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -92530,6 +93168,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -93730,6 +94388,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -102885,6 +103563,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -104536,6 +105226,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -105985,6 +106687,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -107113,6 +107837,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -112480,6 +113224,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -113905,6 +114661,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -115033,6 +115811,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -120400,6 +121198,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -121825,6 +122635,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -122953,6 +123785,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -128320,6 +129172,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", @@ -129745,6 +130609,28 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "password": "\${BITBUCKET_PASSWORD}", + "scheme": "basic", + "username": "\${BITBUCKET_USERNAME}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -130873,6 +131759,26 @@ Object { "origin": "https://\${BITBUCKET}", "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", }, + Object { + "//": "allow webhooks to be fetched", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "GET", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, + Object { + "//": "allow webhooks to be updated", + "auth": Object { + "scheme": "bearer", + "token": "\${BITBUCKET_PAT}", + }, + "method": "PUT", + "origin": "https://\${BITBUCKET}", + "path": "/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId", + }, Object { "//": "used to create commit status messages", "auth": Object { @@ -136240,6 +137146,18 @@ Object { "origin": "https://\${GITLAB}", "path": "/api/v4/projects/:project/hooks/:id", }, + Object { + "//": "allow webhooks to be updated", + "method": "PUT", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, + Object { + "//": "allow webhooks to be fetched, used to facilitate patch upgrades", + "method": "GET", + "origin": "https://\${GITLAB}", + "path": "/api/v4/projects/:project/hooks/:id", + }, Object { "//": "used to create commit status messages", "method": "POST", diff --git a/test/unit/filters.test.ts b/test/unit/filters.test.ts index ac21f2969..881bdc737 100644 --- a/test/unit/filters.test.ts +++ b/test/unit/filters.test.ts @@ -297,6 +297,33 @@ describe('filters', () => { const filterResponseUrl = filterResponse ? filterResponse.url : ''; expect(filterResponseUrl).toMatch(url); }); + + it('should allow fetching webook info', () => { + const url = + '/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId'; + + const filterResponse = filter({ + url, + method: 'GET', + }); + expect(filterResponse).not.toEqual(false); + const filterResponseUrl = filterResponse ? filterResponse.url : ''; + expect(filterResponseUrl).toMatch(url); + }); + + it('should allow updating webhook config', () => { + const url = + '/rest/api/1.0/projects/:project/repos/:repo/webhooks/:webhookId'; + + const filterResponse = filter({ + url, + method: 'PUT', + }); + + expect(filterResponse).not.toEqual(false); + const filterResponseUrl = filterResponse ? filterResponse.url : ''; + expect(filterResponseUrl).toMatch(url); + }); }); describe('for azure repos', () => { @@ -399,6 +426,30 @@ describe('filters', () => { const filterResponseUrl = filterResponse ? filterResponse.url : ''; expect(filterResponseUrl).toMatch(url); }); + + it('should allow fetching webhook info', () => { + const url = '/api/v4/projects/test-project/hooks/1'; + + const filterResponse = filter({ + url, + method: 'GET', + }); + expect(filterResponse).not.toEqual(false); + const filterResponseUrl = filterResponse ? filterResponse.url : ''; + expect(filterResponseUrl).toMatch(url); + }); + + it('should allow updating webhook info', () => { + const url = '/api/v4/projects/test-project/hooks/1'; + + const filterResponse = filter({ + url, + method: 'PUT', + }); + expect(filterResponse).not.toEqual(false); + const filterResponseUrl = filterResponse ? filterResponse.url : ''; + expect(filterResponseUrl).toMatch(url); + }); }); });