From 7bacc660f4bf564ae3848be1d076cf575af2f253 Mon Sep 17 00:00:00 2001 From: Alex Luong Date: Mon, 29 Jan 2024 21:45:32 +0700 Subject: [PATCH] feat: Add missing source verifications (#16) * chore: Update hookdeck go sdk version * feat: Add more source verifications * chore: Tidy module * docs: Generate --- docs/index.md | 2 +- docs/resources/source_verification.md | 108 ++++++++++++++++++ go.mod | 26 ++--- go.sum | 51 +++++---- internal/provider/provider.go | 2 +- internal/provider/sourceverification/model.go | 12 ++ .../provider/sourceverification/schema.go | 12 ++ internal/provider/sourceverification/sdk.go | 24 ++++ .../verification_cloudsignal.go | 31 +++++ .../verification_courier.go | 31 +++++ .../sourceverification/verification_favro.go | 31 +++++ .../sourceverification/verification_nmi.go | 31 +++++ .../verification_persona.go | 31 +++++ .../sourceverification/verification_repay.go | 31 +++++ .../sourceverification/verification_sanity.go | 31 +++++ .../verification_solidgate.go | 31 +++++ .../sourceverification/verification_square.go | 31 +++++ .../sourceverification/verification_trello.go | 31 +++++ .../sourceverification/verification_twitch.go | 31 +++++ .../sourceverification/verification_wix.go | 31 +++++ 20 files changed, 570 insertions(+), 39 deletions(-) create mode 100644 internal/provider/sourceverification/verification_cloudsignal.go create mode 100644 internal/provider/sourceverification/verification_courier.go create mode 100644 internal/provider/sourceverification/verification_favro.go create mode 100644 internal/provider/sourceverification/verification_nmi.go create mode 100644 internal/provider/sourceverification/verification_persona.go create mode 100644 internal/provider/sourceverification/verification_repay.go create mode 100644 internal/provider/sourceverification/verification_sanity.go create mode 100644 internal/provider/sourceverification/verification_solidgate.go create mode 100644 internal/provider/sourceverification/verification_square.go create mode 100644 internal/provider/sourceverification/verification_trello.go create mode 100644 internal/provider/sourceverification/verification_twitch.go create mode 100644 internal/provider/sourceverification/verification_wix.go diff --git a/docs/index.md b/docs/index.md index 2febf1b..b6d8e2b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -46,5 +46,5 @@ resource "hookdeck_connection" "connection" { ### Optional -- `api_base` (String) Hookdeck API Base URL. Alternatively, can be configured using the `HOOKDECK_API_BASE` environment variable. (default: https://api.hookdeck.com/2023-07-01) +- `api_base` (String) Hookdeck API Base URL. Alternatively, can be configured using the `HOOKDECK_API_BASE` environment variable. (default: https://api.hookdeck.com) - `api_key` (String, Sensitive) Hookdeck API Key. Alternatively, can be configured using the `HOOKDECK_API_BASE` environment variable. diff --git a/docs/resources/source_verification.md b/docs/resources/source_verification.md index 73f4599..ebc3b01 100644 --- a/docs/resources/source_verification.md +++ b/docs/resources/source_verification.md @@ -41,24 +41,36 @@ Optional: - `api_key` (Attributes) (see [below for nested schema](#nestedatt--verification--api_key)) - `aws_sns` (Attributes) (see [below for nested schema](#nestedatt--verification--aws_sns)) - `basic_auth` (Attributes) (see [below for nested schema](#nestedatt--verification--basic_auth)) +- `cloudsignal` (Attributes) (see [below for nested schema](#nestedatt--verification--cloudsignal)) - `commercelayer` (Attributes) (see [below for nested schema](#nestedatt--verification--commercelayer)) +- `courier` (Attributes) (see [below for nested schema](#nestedatt--verification--courier)) +- `favro` (Attributes) (see [below for nested schema](#nestedatt--verification--favro)) - `github` (Attributes) (see [below for nested schema](#nestedatt--verification--github)) - `gitlab` (Attributes) (see [below for nested schema](#nestedatt--verification--gitlab)) - `hmac` (Attributes) (see [below for nested schema](#nestedatt--verification--hmac)) - `mailgun` (Attributes) (see [below for nested schema](#nestedatt--verification--mailgun)) +- `nmi` (Attributes) (see [below for nested schema](#nestedatt--verification--nmi)) - `oura` (Attributes) (see [below for nested schema](#nestedatt--verification--oura)) +- `persona` (Attributes) (see [below for nested schema](#nestedatt--verification--persona)) - `pipedrive` (Attributes) (see [below for nested schema](#nestedatt--verification--pipedrive)) - `postmark` (Attributes) (see [below for nested schema](#nestedatt--verification--postmark)) - `property_finder` (Attributes) (see [below for nested schema](#nestedatt--verification--property_finder)) - `recharge` (Attributes) (see [below for nested schema](#nestedatt--verification--recharge)) +- `repay` (Attributes) (see [below for nested schema](#nestedatt--verification--repay)) +- `sanity` (Attributes) (see [below for nested schema](#nestedatt--verification--sanity)) - `sendgrid` (Attributes) (see [below for nested schema](#nestedatt--verification--sendgrid)) - `shopify` (Attributes) (see [below for nested schema](#nestedatt--verification--shopify)) +- `solidgate` (Attributes) (see [below for nested schema](#nestedatt--verification--solidgate)) +- `square` (Attributes) (see [below for nested schema](#nestedatt--verification--square)) - `stripe` (Attributes) (see [below for nested schema](#nestedatt--verification--stripe)) - `svix` (Attributes) (see [below for nested schema](#nestedatt--verification--svix)) - `synctera` (Attributes) (see [below for nested schema](#nestedatt--verification--synctera)) - `threedeye` (Attributes) (see [below for nested schema](#nestedatt--verification--threedeye)) +- `trello` (Attributes) (see [below for nested schema](#nestedatt--verification--trello)) +- `twitch` (Attributes) (see [below for nested schema](#nestedatt--verification--twitch)) - `twitter` (Attributes) (see [below for nested schema](#nestedatt--verification--twitter)) - `typeform` (Attributes) (see [below for nested schema](#nestedatt--verification--typeform)) +- `wix` (Attributes) (see [below for nested schema](#nestedatt--verification--wix)) - `woocommerce` (Attributes) (see [below for nested schema](#nestedatt--verification--woocommerce)) - `workos` (Attributes) (see [below for nested schema](#nestedatt--verification--workos)) - `xero` (Attributes) (see [below for nested schema](#nestedatt--verification--xero)) @@ -102,6 +114,14 @@ Required: - `password` (String, Sensitive) + +### Nested Schema for `verification.cloudsignal` + +Required: + +- `api_key` (String, Sensitive) + + ### Nested Schema for `verification.commercelayer` @@ -110,6 +130,22 @@ Required: - `webhook_secret_key` (String, Sensitive) + +### Nested Schema for `verification.courier` + +Required: + +- `webhook_secret_key` (String, Sensitive) + + + +### Nested Schema for `verification.favro` + +Required: + +- `webhook_secret_key` (String, Sensitive) + + ### Nested Schema for `verification.github` @@ -145,6 +181,14 @@ Required: - `webhook_secret_key` (String, Sensitive) + +### Nested Schema for `verification.nmi` + +Required: + +- `webhook_secret_key` (String, Sensitive) + + ### Nested Schema for `verification.oura` @@ -153,6 +197,14 @@ Required: - `webhook_secret_key` (String, Sensitive) + +### Nested Schema for `verification.persona` + +Required: + +- `webhook_secret_key` (String, Sensitive) + + ### Nested Schema for `verification.pipedrive` @@ -186,6 +238,22 @@ Required: - `webhook_secret_key` (String, Sensitive) + +### Nested Schema for `verification.repay` + +Required: + +- `webhook_secret_key` (String, Sensitive) + + + +### Nested Schema for `verification.sanity` + +Required: + +- `webhook_secret_key` (String, Sensitive) + + ### Nested Schema for `verification.sendgrid` @@ -202,6 +270,22 @@ Required: - `webhook_secret_key` (String, Sensitive) + +### Nested Schema for `verification.solidgate` + +Required: + +- `webhook_secret_key` (String, Sensitive) + + + +### Nested Schema for `verification.square` + +Required: + +- `webhook_secret_key` (String, Sensitive) + + ### Nested Schema for `verification.stripe` @@ -234,6 +318,22 @@ Required: - `webhook_secret_key` (String, Sensitive) + +### Nested Schema for `verification.trello` + +Required: + +- `webhook_secret_key` (String, Sensitive) + + + +### Nested Schema for `verification.twitch` + +Required: + +- `webhook_secret_key` (String, Sensitive) + + ### Nested Schema for `verification.twitter` @@ -250,6 +350,14 @@ Required: - `webhook_secret_key` (String, Sensitive) + +### Nested Schema for `verification.wix` + +Required: + +- `webhook_secret_key` (String, Sensitive) + + ### Nested Schema for `verification.woocommerce` diff --git a/go.mod b/go.mod index 0171096..a686d3b 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/hashicorp/terraform-plugin-framework v1.5.0 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 github.com/hashicorp/terraform-plugin-log v0.9.0 - github.com/hookdeck/hookdeck-go-sdk v0.0.34 + github.com/hookdeck/hookdeck-go-sdk v0.0.36 ) require ( @@ -19,13 +19,13 @@ require ( github.com/armon/go-radix v1.0.0 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/cloudflare/circl v1.3.3 // indirect - github.com/fatih/color v1.13.0 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/uuid v1.3.1 // indirect + github.com/google/uuid v1.4.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-hclog v1.6.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect @@ -40,12 +40,12 @@ require ( github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/cli v1.1.5 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/oklog/run v1.0.0 // indirect + github.com/oklog/run v1.1.0 // indirect github.com/posener/complete v1.2.3 // indirect github.com/russross/blackfriday v1.6.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect @@ -53,13 +53,13 @@ require ( github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/zclconf/go-cty v1.13.2 // indirect - golang.org/x/crypto v0.14.0 // indirect + golang.org/x/crypto v0.18.0 // indirect golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect golang.org/x/mod v0.11.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/grpc v1.60.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/sys v0.16.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect + google.golang.org/grpc v1.61.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect ) diff --git a/go.sum b/go.sum index 9e05e6f..a234f2e 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,9 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= @@ -39,8 +40,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -49,8 +50,8 @@ github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuD github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.6.2 h1:NOtoftovWkDheyUM/8JW3QMiXyxJK3uHRK7wV04nD2I= +github.com/hashicorp/go-hclog v1.6.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= @@ -83,8 +84,8 @@ github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/hookdeck/hookdeck-go-sdk v0.0.34 h1:nPcaa/iJjGe2O1q2zZXVC5SrhQEJv5w63lQ+CCwIw84= -github.com/hookdeck/hookdeck-go-sdk v0.0.34/go.mod h1:kfFn3/WEGcxuPkaaf8lAq9L+3nYg45GwGy4utH/Tnmg= +github.com/hookdeck/hookdeck-go-sdk v0.0.36 h1:ux0RKjTIUYV+83lQ1N2zA3mtU35OfD+WMna6H5RKceQ= +github.com/hookdeck/hookdeck-go-sdk v0.0.36/go.mod h1:kfFn3/WEGcxuPkaaf8lAq9L+3nYg45GwGy4utH/Tnmg= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -104,8 +105,9 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -116,8 +118,8 @@ github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -153,16 +155,16 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -174,23 +176,24 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe h1:bQnxqljG/wqi4NTXu2+DJ3n7APcEA882QZ1JvhQAq9o= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= +google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/internal/provider/provider.go b/internal/provider/provider.go index da645a6..4b41ba5 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -179,5 +179,5 @@ const ( apiBaseEnvVarKey = "HOOKDECK_API_BASE" apiKeyEnvVarKey = "HOOKDECK_API_KEY" - defaultHookdeckAPIBase = "https://api.hookdeck.com/2023-07-01" + defaultHookdeckAPIBase = "https://api.hookdeck.com" ) diff --git a/internal/provider/sourceverification/model.go b/internal/provider/sourceverification/model.go index edcdc71..c0ad37f 100644 --- a/internal/provider/sourceverification/model.go +++ b/internal/provider/sourceverification/model.go @@ -16,23 +16,35 @@ type sourceVerification struct { Adyen *adyenSourceVerification `tfsdk:"adyen"` Akeneo *akeneoSourceVerification `tfsdk:"akeneo"` AWSSNS *awsSNSSourceVerification `tfsdk:"aws_sns"` + Cloudsignal *cloudsignalSourceVerification `tfsdk:"cloudsignal"` Commercelayer *commercelayerSourceVerification `tfsdk:"commercelayer"` + Courier *courierSourceVerification `tfsdk:"courier"` + Favro *favroSourceVerification `tfsdk:"favro"` GitHub *githubSourceVerification `tfsdk:"github"` GitLab *gitlabSourceVerification `tfsdk:"gitlab"` Mailgun *mailgunSourceVerification `tfsdk:"mailgun"` + Nmi *nmiSourceVerification `tfsdk:"nmi"` Oura *ouraSourceVerification `tfsdk:"oura"` + Persona *personaSourceVerification `tfsdk:"persona"` Pipedrive *pipedriveSourceVerification `tfsdk:"pipedrive"` Postmark *postmarkSourceVerification `tfsdk:"postmark"` PropertyFinder *propertyFinderSourceVerification `tfsdk:"property_finder"` Recharge *rechargeSourceVerification `tfsdk:"recharge"` + Repay *repaySourceVerification `tfsdk:"repay"` + Sanity *sanitySourceVerification `tfsdk:"sanity"` SendGrid *sendgridSourceVerification `tfsdk:"sendgrid"` Shopify *shopifySourceVerification `tfsdk:"shopify"` + Solidgate *solidgateSourceVerification `tfsdk:"solidgate"` + Square *squareSourceVerification `tfsdk:"square"` Stripe *stripeSourceVerification `tfsdk:"stripe"` Svix *svixSourceVerification `tfsdk:"svix"` Synctera *syncteraSourceVerification `tfsdk:"synctera"` ThreeDEye *threeDEyeSourceVerification `tfsdk:"threedeye"` + Trello *trelloSourceVerification `tfsdk:"trello"` + Twitch *twitchSourceVerification `tfsdk:"twitch"` Twitter *twitterSourceVerification `tfsdk:"twitter"` Typeform *typeformSourceVerification `tfsdk:"typeform"` + Wix *wixSourceVerification `tfsdk:"wix"` WooCommerce *woocommerceSourceVerification `tfsdk:"woocommerce"` WorkOS *workOSSourceVerification `tfsdk:"workos"` Xero *xeroSourceVerification `tfsdk:"xero"` diff --git a/internal/provider/sourceverification/schema.go b/internal/provider/sourceverification/schema.go index b73f023..5519513 100644 --- a/internal/provider/sourceverification/schema.go +++ b/internal/provider/sourceverification/schema.go @@ -33,23 +33,35 @@ func (r *sourceVerificationResource) Schema(_ context.Context, _ resource.Schema "adyen": adyenConfigSchema(), "akeneo": akeneoConfigSchema(), "aws_sns": awsSNSConfigSchema(), + "cloudsignal": cloudsignalConfigSchema(), "commercelayer": commercelayerConfigSchema(), + "courier": courierConfigSchema(), + "favro": favroConfigSchema(), "github": githubConfigSchema(), "gitlab": gitlabConfigSchema(), "mailgun": mailgunConfigSchema(), + "nmi": nmiConfigSchema(), "oura": ouraConfigSchema(), + "persona": personaConfigSchema(), "pipedrive": pipedriveConfigSchema(), "postmark": postmarkConfigSchema(), "property_finder": propertyFinderConfigSchema(), "recharge": rechargeConfigSchema(), + "repay": repayConfigSchema(), + "sanity": sanityConfigSchema(), "sendgrid": sendgridConfigSchema(), "shopify": shopifyConfigSchema(), + "solidgate": solidgateConfigSchema(), + "square": squareConfigSchema(), "stripe": stripeConfigSchema(), "svix": svixConfigSchema(), "synctera": syncteraConfigSchema(), "threedeye": threeDEyeConfigSchema(), + "trello": trelloConfigSchema(), + "twitch": twitchConfigSchema(), "twitter": twitterConfigSchema(), "typeform": typeformConfigSchema(), + "wix": wixConfigSchema(), "woocommerce": woocommerceConfigSchema(), "workos": workOSConfigSchema(), "xero": xeroConfigSchema(), diff --git a/internal/provider/sourceverification/sdk.go b/internal/provider/sourceverification/sdk.go index d1ad458..1edbaff 100644 --- a/internal/provider/sourceverification/sdk.go +++ b/internal/provider/sourceverification/sdk.go @@ -29,16 +29,26 @@ func (m *sourceVerificationResourceModel) ToUpdatePayload() *hookdeck.SourceUpda verification = m.Verification.Akeneo.toPayload() } else if m.Verification.AWSSNS != nil { verification = m.Verification.AWSSNS.toPayload() + } else if m.Verification.Cloudsignal != nil { + verification = m.Verification.Cloudsignal.toPayload() } else if m.Verification.Commercelayer != nil { verification = m.Verification.Commercelayer.toPayload() + } else if m.Verification.Courier != nil { + verification = m.Verification.Courier.toPayload() + } else if m.Verification.Favro != nil { + verification = m.Verification.Favro.toPayload() } else if m.Verification.GitHub != nil { verification = m.Verification.GitHub.toPayload() } else if m.Verification.GitLab != nil { verification = m.Verification.GitLab.toPayload() } else if m.Verification.Mailgun != nil { verification = m.Verification.Mailgun.toPayload() + } else if m.Verification.Nmi != nil { + verification = m.Verification.Nmi.toPayload() } else if m.Verification.Oura != nil { verification = m.Verification.Oura.toPayload() + } else if m.Verification.Persona != nil { + verification = m.Verification.Persona.toPayload() } else if m.Verification.Pipedrive != nil { verification = m.Verification.Pipedrive.toPayload() } else if m.Verification.Postmark != nil { @@ -47,10 +57,18 @@ func (m *sourceVerificationResourceModel) ToUpdatePayload() *hookdeck.SourceUpda verification = m.Verification.PropertyFinder.toPayload() } else if m.Verification.Recharge != nil { verification = m.Verification.Recharge.toPayload() + } else if m.Verification.Repay != nil { + verification = m.Verification.Repay.toPayload() + } else if m.Verification.Sanity != nil { + verification = m.Verification.Sanity.toPayload() } else if m.Verification.SendGrid != nil { verification = m.Verification.SendGrid.toPayload() } else if m.Verification.Shopify != nil { verification = m.Verification.Shopify.toPayload() + } else if m.Verification.Solidgate != nil { + verification = m.Verification.Solidgate.toPayload() + } else if m.Verification.Square != nil { + verification = m.Verification.Square.toPayload() } else if m.Verification.Stripe != nil { verification = m.Verification.Stripe.toPayload() } else if m.Verification.Svix != nil { @@ -59,10 +77,16 @@ func (m *sourceVerificationResourceModel) ToUpdatePayload() *hookdeck.SourceUpda verification = m.Verification.Synctera.toPayload() } else if m.Verification.ThreeDEye != nil { verification = m.Verification.ThreeDEye.toPayload() + } else if m.Verification.Trello != nil { + verification = m.Verification.Trello.toPayload() + } else if m.Verification.Twitch != nil { + verification = m.Verification.Twitch.toPayload() } else if m.Verification.Twitter != nil { verification = m.Verification.Twitter.toPayload() } else if m.Verification.Typeform != nil { verification = m.Verification.Typeform.toPayload() + } else if m.Verification.Wix != nil { + verification = m.Verification.Wix.toPayload() } else if m.Verification.WooCommerce != nil { verification = m.Verification.WooCommerce.toPayload() } else if m.Verification.WorkOS != nil { diff --git a/internal/provider/sourceverification/verification_cloudsignal.go b/internal/provider/sourceverification/verification_cloudsignal.go new file mode 100644 index 0000000..c012c8d --- /dev/null +++ b/internal/provider/sourceverification/verification_cloudsignal.go @@ -0,0 +1,31 @@ +package sourceverification + +import ( + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + hookdeck "github.com/hookdeck/hookdeck-go-sdk" +) + +func cloudsignalConfigSchema() schema.SingleNestedAttribute { + return schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "api_key": schema.StringAttribute{ + Required: true, + Sensitive: true, + }, + }, + } +} + +type cloudsignalSourceVerification struct { + APIKey types.String `tfsdk:"api_key"` +} + +func (m *cloudsignalSourceVerification) toPayload() *hookdeck.VerificationConfig { + return hookdeck.NewVerificationConfigFromCloudsignal(&hookdeck.VerificationCloudSignal{ + Configs: &hookdeck.VerificationCloudSignalConfigs{ + ApiKey: m.APIKey.ValueString(), + }, + }) +} diff --git a/internal/provider/sourceverification/verification_courier.go b/internal/provider/sourceverification/verification_courier.go new file mode 100644 index 0000000..d3b4f93 --- /dev/null +++ b/internal/provider/sourceverification/verification_courier.go @@ -0,0 +1,31 @@ +package sourceverification + +import ( + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + hookdeck "github.com/hookdeck/hookdeck-go-sdk" +) + +func courierConfigSchema() schema.SingleNestedAttribute { + return schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "webhook_secret_key": schema.StringAttribute{ + Required: true, + Sensitive: true, + }, + }, + } +} + +type courierSourceVerification struct { + WebhookSecretKey types.String `tfsdk:"webhook_secret_key"` +} + +func (m *courierSourceVerification) toPayload() *hookdeck.VerificationConfig { + return hookdeck.NewVerificationConfigFromCourier(&hookdeck.VerificationCourier{ + Configs: &hookdeck.VerificationCourierConfigs{ + WebhookSecretKey: m.WebhookSecretKey.ValueString(), + }, + }) +} diff --git a/internal/provider/sourceverification/verification_favro.go b/internal/provider/sourceverification/verification_favro.go new file mode 100644 index 0000000..fbdd178 --- /dev/null +++ b/internal/provider/sourceverification/verification_favro.go @@ -0,0 +1,31 @@ +package sourceverification + +import ( + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + hookdeck "github.com/hookdeck/hookdeck-go-sdk" +) + +func favroConfigSchema() schema.SingleNestedAttribute { + return schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "webhook_secret_key": schema.StringAttribute{ + Required: true, + Sensitive: true, + }, + }, + } +} + +type favroSourceVerification struct { + WebhookSecretKey types.String `tfsdk:"webhook_secret_key"` +} + +func (m *favroSourceVerification) toPayload() *hookdeck.VerificationConfig { + return hookdeck.NewVerificationConfigFromFavro(&hookdeck.VerificationFavro{ + Configs: &hookdeck.VerificationFavroConfigs{ + WebhookSecretKey: m.WebhookSecretKey.ValueString(), + }, + }) +} diff --git a/internal/provider/sourceverification/verification_nmi.go b/internal/provider/sourceverification/verification_nmi.go new file mode 100644 index 0000000..5e3f688 --- /dev/null +++ b/internal/provider/sourceverification/verification_nmi.go @@ -0,0 +1,31 @@ +package sourceverification + +import ( + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + hookdeck "github.com/hookdeck/hookdeck-go-sdk" +) + +func nmiConfigSchema() schema.SingleNestedAttribute { + return schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "webhook_secret_key": schema.StringAttribute{ + Required: true, + Sensitive: true, + }, + }, + } +} + +type nmiSourceVerification struct { + WebhookSecretKey types.String `tfsdk:"webhook_secret_key"` +} + +func (m *nmiSourceVerification) toPayload() *hookdeck.VerificationConfig { + return hookdeck.NewVerificationConfigFromNmi(&hookdeck.VerificationNmiPaymentGateway{ + Configs: &hookdeck.VerificationNmiPaymentGatewayConfigs{ + WebhookSecretKey: m.WebhookSecretKey.ValueString(), + }, + }) +} diff --git a/internal/provider/sourceverification/verification_persona.go b/internal/provider/sourceverification/verification_persona.go new file mode 100644 index 0000000..525d1a8 --- /dev/null +++ b/internal/provider/sourceverification/verification_persona.go @@ -0,0 +1,31 @@ +package sourceverification + +import ( + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + hookdeck "github.com/hookdeck/hookdeck-go-sdk" +) + +func personaConfigSchema() schema.SingleNestedAttribute { + return schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "webhook_secret_key": schema.StringAttribute{ + Required: true, + Sensitive: true, + }, + }, + } +} + +type personaSourceVerification struct { + WebhookSecretKey types.String `tfsdk:"webhook_secret_key"` +} + +func (m *personaSourceVerification) toPayload() *hookdeck.VerificationConfig { + return hookdeck.NewVerificationConfigFromPersona(&hookdeck.VerificationPersona{ + Configs: &hookdeck.VerificationPersonaConfigs{ + WebhookSecretKey: m.WebhookSecretKey.ValueString(), + }, + }) +} diff --git a/internal/provider/sourceverification/verification_repay.go b/internal/provider/sourceverification/verification_repay.go new file mode 100644 index 0000000..02e0e08 --- /dev/null +++ b/internal/provider/sourceverification/verification_repay.go @@ -0,0 +1,31 @@ +package sourceverification + +import ( + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + hookdeck "github.com/hookdeck/hookdeck-go-sdk" +) + +func repayConfigSchema() schema.SingleNestedAttribute { + return schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "webhook_secret_key": schema.StringAttribute{ + Required: true, + Sensitive: true, + }, + }, + } +} + +type repaySourceVerification struct { + WebhookSecretKey types.String `tfsdk:"webhook_secret_key"` +} + +func (m *repaySourceVerification) toPayload() *hookdeck.VerificationConfig { + return hookdeck.NewVerificationConfigFromRepay(&hookdeck.VerificationRepay{ + Configs: &hookdeck.VerificationRepayConfigs{ + WebhookSecretKey: m.WebhookSecretKey.ValueString(), + }, + }) +} diff --git a/internal/provider/sourceverification/verification_sanity.go b/internal/provider/sourceverification/verification_sanity.go new file mode 100644 index 0000000..f748804 --- /dev/null +++ b/internal/provider/sourceverification/verification_sanity.go @@ -0,0 +1,31 @@ +package sourceverification + +import ( + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + hookdeck "github.com/hookdeck/hookdeck-go-sdk" +) + +func sanityConfigSchema() schema.SingleNestedAttribute { + return schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "webhook_secret_key": schema.StringAttribute{ + Required: true, + Sensitive: true, + }, + }, + } +} + +type sanitySourceVerification struct { + WebhookSecretKey types.String `tfsdk:"webhook_secret_key"` +} + +func (m *sanitySourceVerification) toPayload() *hookdeck.VerificationConfig { + return hookdeck.NewVerificationConfigFromSanity(&hookdeck.VerificationSanity{ + Configs: &hookdeck.VerificationSanityConfigs{ + WebhookSecretKey: m.WebhookSecretKey.ValueString(), + }, + }) +} diff --git a/internal/provider/sourceverification/verification_solidgate.go b/internal/provider/sourceverification/verification_solidgate.go new file mode 100644 index 0000000..c9fe329 --- /dev/null +++ b/internal/provider/sourceverification/verification_solidgate.go @@ -0,0 +1,31 @@ +package sourceverification + +import ( + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + hookdeck "github.com/hookdeck/hookdeck-go-sdk" +) + +func solidgateConfigSchema() schema.SingleNestedAttribute { + return schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "webhook_secret_key": schema.StringAttribute{ + Required: true, + Sensitive: true, + }, + }, + } +} + +type solidgateSourceVerification struct { + WebhookSecretKey types.String `tfsdk:"webhook_secret_key"` +} + +func (m *solidgateSourceVerification) toPayload() *hookdeck.VerificationConfig { + return hookdeck.NewVerificationConfigFromSolidgate(&hookdeck.VerificationSolidGate{ + Configs: &hookdeck.VerificationSolidGateConfigs{ + WebhookSecretKey: m.WebhookSecretKey.ValueString(), + }, + }) +} diff --git a/internal/provider/sourceverification/verification_square.go b/internal/provider/sourceverification/verification_square.go new file mode 100644 index 0000000..249830b --- /dev/null +++ b/internal/provider/sourceverification/verification_square.go @@ -0,0 +1,31 @@ +package sourceverification + +import ( + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + hookdeck "github.com/hookdeck/hookdeck-go-sdk" +) + +func squareConfigSchema() schema.SingleNestedAttribute { + return schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "webhook_secret_key": schema.StringAttribute{ + Required: true, + Sensitive: true, + }, + }, + } +} + +type squareSourceVerification struct { + WebhookSecretKey types.String `tfsdk:"webhook_secret_key"` +} + +func (m *squareSourceVerification) toPayload() *hookdeck.VerificationConfig { + return hookdeck.NewVerificationConfigFromSquare(&hookdeck.VerificationSquare{ + Configs: &hookdeck.VerificationSquareConfigs{ + WebhookSecretKey: m.WebhookSecretKey.ValueString(), + }, + }) +} diff --git a/internal/provider/sourceverification/verification_trello.go b/internal/provider/sourceverification/verification_trello.go new file mode 100644 index 0000000..3b7cf17 --- /dev/null +++ b/internal/provider/sourceverification/verification_trello.go @@ -0,0 +1,31 @@ +package sourceverification + +import ( + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + hookdeck "github.com/hookdeck/hookdeck-go-sdk" +) + +func trelloConfigSchema() schema.SingleNestedAttribute { + return schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "webhook_secret_key": schema.StringAttribute{ + Required: true, + Sensitive: true, + }, + }, + } +} + +type trelloSourceVerification struct { + WebhookSecretKey types.String `tfsdk:"webhook_secret_key"` +} + +func (m *trelloSourceVerification) toPayload() *hookdeck.VerificationConfig { + return hookdeck.NewVerificationConfigFromTrello(&hookdeck.VerificationTrello{ + Configs: &hookdeck.VerificationTrelloConfigs{ + WebhookSecretKey: m.WebhookSecretKey.ValueString(), + }, + }) +} diff --git a/internal/provider/sourceverification/verification_twitch.go b/internal/provider/sourceverification/verification_twitch.go new file mode 100644 index 0000000..30a1c6b --- /dev/null +++ b/internal/provider/sourceverification/verification_twitch.go @@ -0,0 +1,31 @@ +package sourceverification + +import ( + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + hookdeck "github.com/hookdeck/hookdeck-go-sdk" +) + +func twitchConfigSchema() schema.SingleNestedAttribute { + return schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "webhook_secret_key": schema.StringAttribute{ + Required: true, + Sensitive: true, + }, + }, + } +} + +type twitchSourceVerification struct { + WebhookSecretKey types.String `tfsdk:"webhook_secret_key"` +} + +func (m *twitchSourceVerification) toPayload() *hookdeck.VerificationConfig { + return hookdeck.NewVerificationConfigFromTwitch(&hookdeck.VerificationTwitch{ + Configs: &hookdeck.VerificationTwitchConfigs{ + WebhookSecretKey: m.WebhookSecretKey.ValueString(), + }, + }) +} diff --git a/internal/provider/sourceverification/verification_wix.go b/internal/provider/sourceverification/verification_wix.go new file mode 100644 index 0000000..a98f6b0 --- /dev/null +++ b/internal/provider/sourceverification/verification_wix.go @@ -0,0 +1,31 @@ +package sourceverification + +import ( + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + hookdeck "github.com/hookdeck/hookdeck-go-sdk" +) + +func wixConfigSchema() schema.SingleNestedAttribute { + return schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "webhook_secret_key": schema.StringAttribute{ + Required: true, + Sensitive: true, + }, + }, + } +} + +type wixSourceVerification struct { + WebhookSecretKey types.String `tfsdk:"webhook_secret_key"` +} + +func (m *wixSourceVerification) toPayload() *hookdeck.VerificationConfig { + return hookdeck.NewVerificationConfigFromWix(&hookdeck.VerificationWix{ + Configs: &hookdeck.VerificationWixConfigs{ + WebhookSecretKey: m.WebhookSecretKey.ValueString(), + }, + }) +}