-setWebhookDefaults required to take in a pointer - other wise the fields were not being set on the original webhook.
-divided the function into two separate functions one for V1 defaults and one for V2 defaults otherwise we would have had to do a type assertion within setWebhookDefaults on non pointer structs and then returned an empty interface and done yet another type assertion on the return value to set the registration within the Register interface.
:warning: We detected 4 security issues in this pull request:
Vulnerable Libraries (4)
Severity | Details
:-: | :--
High | [pkg:golang/github.com/xmidt-org/webhook-schema@v0.1.1-0.20240711140319-0ee06ff248b5](https://github.com/xmidt-org/ancla/blob/ca500b354872292bbf09f2c98500db59808b73eb/go.mod#L20) upgrade to: *> v0.1.1-0.20240711140319-0ee06ff248b5*
High | [pkg:golang/github.com/xmidt-org/touchstone@v0.1.5](https://github.com/xmidt-org/ancla/blob/ca500b354872292bbf09f2c98500db59808b73eb/go.mod#L18) upgrade to: *> v0.1.5*
High | [pkg:golang/github.com/xmidt-org/urlegit@v0.1.12](https://github.com/xmidt-org/ancla/blob/ca500b354872292bbf09f2c98500db59808b73eb/go.mod#L19) upgrade to: *> v0.1.12*
High | [pkg:golang/github.com/xmidt-org/argus@v0.9.13-0.20240711141248-1f7e75700ffb](https://github.com/xmidt-org/ancla/blob/ca500b354872292bbf09f2c98500db59808b73eb/go.mod#L14) upgrade to: *> v0.9.13-0.20240711141248-1f7e75700ffb*
More info on how to fix Vulnerable Libraries in [Go](https://docs.guardrails.io/docs/en/vulnerabilities/go/using_vulnerable_libraries.html?utm_source=ghpr).
-setWebhookDefaults required to take in a pointer - other wise the fields were not being set on the original webhook. -divided the function into two separate functions one for V1 defaults and one for V2 defaults otherwise we would have had to do a type assertion within setWebhookDefaults on non pointer structs and then returned an empty interface and done yet another type assertion on the return value to set the registration within the Register interface.