Skip to content

Commit

Permalink
Fix/rate limit period concurrent (#129)
Browse files Browse the repository at this point in the history
* fix: add "concurrent" to rate_limit.period validation

* chore: remove old API key

* chore: Ignore the terraform provider locally built binary

* chore: add hashicorp/setup-terraform@v3 dependency

* chore: bump Hookdeck Go SDK to v0.7.0

* chore: correctly bump Hookdeck SDK

* chore: generate

* chore: add rate_limit.period = "concurrent" example

* chore: lint fix
  • Loading branch information
leggetter authored Dec 11, 2024
1 parent 6063197 commit 8efbf92
Show file tree
Hide file tree
Showing 13 changed files with 196 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: hashicorp/setup-terraform@v3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ website/vendor

/examples/dev

*.lock.hcl
*.lock.hcl

# Ignore the terraform provider locally built binary
terraform-provider-hookdeck
2 changes: 1 addition & 1 deletion docs/data-sources/destination.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,5 @@ Basic (default) or Bearer Authentication
Read-Only:

- `limit` (Number) Limit event attempts to receive per period. Max value is workspace plan's max attempts thoughput.
- `period` (String) must be one of ["second", "minute", "hour"]
- `period` (String) must be one of ["second", "minute", "hour", "concurrent"]
Period to rate limit attempts
2 changes: 1 addition & 1 deletion docs/resources/destination.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Basic (default) or Bearer Authentication
Required:

- `limit` (Number) Limit event attempts to receive per period. Max value is workspace plan's max attempts thoughput.
- `period` (String) must be one of ["second", "minute", "hour"]
- `period` (String) must be one of ["second", "minute", "hour", "concurrent"]
Period to rate limit attempts

## Import
Expand Down
27 changes: 27 additions & 0 deletions docs/resources/source_verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Optional:
- `aws_sns` (Attributes) (see [below for nested schema](#nestedatt--verification--aws_sns))
- `basic_auth` (Attributes) (see [below for nested schema](#nestedatt--verification--basic_auth))
- `bondsmith` (Attributes) (see [below for nested schema](#nestedatt--verification--bondsmith))
- `bridge` (Attributes) (see [below for nested schema](#nestedatt--verification--bridge))
- `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))
Expand All @@ -67,6 +68,7 @@ Optional:
- `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))
- `praxis` (Attributes) (see [below for nested schema](#nestedatt--verification--praxis))
- `property_finder` (Attributes) (see [below for nested schema](#nestedatt--verification--property_finder))
- `pylon` (Attributes) (see [below for nested schema](#nestedatt--verification--pylon))
- `razorpay` (Attributes) (see [below for nested schema](#nestedatt--verification--razorpay))
Expand All @@ -86,6 +88,7 @@ Optional:
- `telnyx` (Attributes) (see [below for nested schema](#nestedatt--verification--telnyx))
- `three_d_eye` (Attributes) (see [below for nested schema](#nestedatt--verification--three_d_eye))
- `tokenio` (Attributes) (see [below for nested schema](#nestedatt--verification--tokenio))
- `treezor` (Attributes) (see [below for nested schema](#nestedatt--verification--treezor))
- `trello` (Attributes) (see [below for nested schema](#nestedatt--verification--trello))
- `twilio` (Attributes) (see [below for nested schema](#nestedatt--verification--twilio))
- `twitch` (Attributes) (see [below for nested schema](#nestedatt--verification--twitch))
Expand Down Expand Up @@ -145,6 +148,14 @@ Required:
- `webhook_secret_key` (String, Sensitive)


<a id="nestedatt--verification--bridge"></a>
### Nested Schema for `verification.bridge`

Required:

- `public_key` (String, Sensitive)


<a id="nestedatt--verification--cloudsignal"></a>
### Nested Schema for `verification.cloudsignal`

Expand Down Expand Up @@ -346,6 +357,14 @@ Required:
- `username` (String, Sensitive)


<a id="nestedatt--verification--praxis"></a>
### Nested Schema for `verification.praxis`

Required:

- `webhook_secret_key` (String, Sensitive)


<a id="nestedatt--verification--property_finder"></a>
### Nested Schema for `verification.property_finder`

Expand Down Expand Up @@ -498,6 +517,14 @@ Required:
- `public_key` (String, Sensitive)


<a id="nestedatt--verification--treezor"></a>
### Nested Schema for `verification.treezor`

Required:

- `webhook_secret_key` (String, Sensitive)


<a id="nestedatt--verification--trello"></a>
### Nested Schema for `verification.trello`

Expand Down
4 changes: 4 additions & 0 deletions examples/full/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ resource "hookdeck_destination" "second_destination" {
password = "blah-blah-blah"
}
}
rate_limit = {
period = "concurrent"
limit = 10
}
}

resource "hookdeck_destination" "aws_destination" {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/hashicorp/terraform-plugin-framework v1.11.0
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hookdeck/hookdeck-go-sdk v0.6.0
github.com/hookdeck/hookdeck-go-sdk v0.7.0
github.com/iancoleman/strcase v0.3.0
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa
golang.org/x/sys v0.24.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ 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.6.0 h1:OEtw5cRV7ShDMfus8BjYKqi9wGHQ8/y4R5qEyUINZQQ=
github.com/hookdeck/hookdeck-go-sdk v0.6.0/go.mod h1:fewtdP5f8hnU+x35l2s8F3SSiE94cGz+Q3bR4sI8zlk=
github.com/hookdeck/hookdeck-go-sdk v0.7.0 h1:s+4gVXcoTwTcukdn6Fc2BydewmkK2QXyIZvAUQsIoVs=
github.com/hookdeck/hookdeck-go-sdk v0.7.0/go.mod h1:fewtdP5f8hnU+x35l2s8F3SSiE94cGz+Q3bR4sI8zlk=
github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4=
github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
Expand Down
3 changes: 2 additions & 1 deletion internal/provider/destination/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,13 @@ func schemaAttributes() map[string]schema.Attribute {
"second",
"minute",
"hour",
"concurrent",
),
},
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
MarkdownDescription: `must be one of ["second", "minute", "hour"]` + "\n" +
MarkdownDescription: `must be one of ["second", "minute", "hour", "concurrent"]` + "\n" +
`Period to rate limit attempts`,
},
},
Expand Down
3 changes: 3 additions & 0 deletions internal/provider/sourceverification/generated/model.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8efbf92

Please sign in to comment.