From 2ece431466cfb6c3053aa8d59329053798b3e937 Mon Sep 17 00:00:00 2001 From: maura fortino Date: Fri, 3 Nov 2023 15:54:13 -0400 Subject: [PATCH 1/2] made ?webhook= a constant to fix linter --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 4c08bcd..49532ab 100644 --- a/main.go +++ b/main.go @@ -31,7 +31,6 @@ import ( "github.com/xmidt-org/webpa-common/v2/logging" // nolint: staticcheck "github.com/xmidt-org/webpa-common/v2/server" // nolint: staticcheck "github.com/xmidt-org/wrp-go/v3" - webhook "github.com/xmidt-org/wrp-listener" "github.com/xmidt-org/wrp-listener/hashTokenFactory" secretGetter "github.com/xmidt-org/wrp-listener/secret" "github.com/xmidt-org/wrp-listener/webhookClient" @@ -41,6 +40,7 @@ import ( const ( applicationName = "caduceator" + webhook = "?webhook=" ) var ( @@ -441,13 +441,13 @@ func main() { // set up the registerer basicConfig := webhookClient.BasicConfig{ Timeout: config.Webhook.Timeout, - RegistrationURL: config.Webhook.RegistrationURL + "?webhook=" + strconv.Itoa(i), + RegistrationURL: config.Webhook.RegistrationURL + webhook + strconv.Itoa(i), Request: webhook.W{ Config: webhook.Config{ - URL: config.Webhook.Request.WebhookConfig.URL + "?webhook=" + strconv.Itoa(i), + URL: config.Webhook.Request.WebhookConfig.URL + webhook + strconv.Itoa(i), }, Events: []string{config.Webhook.Request.Events}, - FailureURL: config.Webhook.Request.WebhookConfig.FailureURL + "?webhook=" + strconv.Itoa(i), + FailureURL: config.Webhook.Request.WebhookConfig.FailureURL + webhook + strconv.Itoa(i), }, } From 0b6be306fd87b22e65ebe09d50ae5546df5433cd Mon Sep 17 00:00:00 2001 From: maura fortino Date: Fri, 3 Nov 2023 16:20:23 -0400 Subject: [PATCH 2/2] addded back webhook import and changed webhook var to whparam --- main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 49532ab..f69b1bb 100644 --- a/main.go +++ b/main.go @@ -31,6 +31,7 @@ import ( "github.com/xmidt-org/webpa-common/v2/logging" // nolint: staticcheck "github.com/xmidt-org/webpa-common/v2/server" // nolint: staticcheck "github.com/xmidt-org/wrp-go/v3" + webhook "github.com/xmidt-org/wrp-listener" "github.com/xmidt-org/wrp-listener/hashTokenFactory" secretGetter "github.com/xmidt-org/wrp-listener/secret" "github.com/xmidt-org/wrp-listener/webhookClient" @@ -40,7 +41,7 @@ import ( const ( applicationName = "caduceator" - webhook = "?webhook=" + whparam = "?webhook=" ) var ( @@ -441,13 +442,13 @@ func main() { // set up the registerer basicConfig := webhookClient.BasicConfig{ Timeout: config.Webhook.Timeout, - RegistrationURL: config.Webhook.RegistrationURL + webhook + strconv.Itoa(i), + RegistrationURL: config.Webhook.RegistrationURL + whparam + strconv.Itoa(i), Request: webhook.W{ Config: webhook.Config{ - URL: config.Webhook.Request.WebhookConfig.URL + webhook + strconv.Itoa(i), + URL: config.Webhook.Request.WebhookConfig.URL + whparam + strconv.Itoa(i), }, Events: []string{config.Webhook.Request.Events}, - FailureURL: config.Webhook.Request.WebhookConfig.FailureURL + webhook + strconv.Itoa(i), + FailureURL: config.Webhook.Request.WebhookConfig.FailureURL + whparam + strconv.Itoa(i), }, }