Skip to content

fix: validate requests_per_second - #83

Open
worlldz wants to merge 1 commit into
circlefin:mainfrom
worlldz:agent/validate-requests-per-second
Open

worlldz wants to merge 1 commit into
circlefin:mainfrom
worlldz:agent/validate-requests-per-second

Conversation

@worlldz

@worlldz worlldz commented Aug 15, 2026

Copy link
Copy Markdown

Summary

  • reject requests_per_second values below 1 during provider configuration validation
  • add a reusable minimum-value validator without introducing a new dependency
  • cover null, unknown, invalid, boundary, and positive values through the provider schema

Why

The provider currently passes requests_per_second directly to rate.NewLimiter as both the rate and burst size. Values of zero or less create a limiter that cannot service a request, so an accepted Terraform configuration fails later during the first API call with a rate limiter error.

Validating the value in the provider schema gives users an immediate, attribute-specific diagnostic while preserving the existing default of 5 requests per second.

Testing

  • go test ./... -run Test -skip TestAcc
  • go build .
  • go vet ./...
  • go tool staticcheck ./...

@worlldz
worlldz marked this pull request as ready for review August 15, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant