From abb6ce3bc925df053b4d97361e981b599ac658b1 Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Thu, 19 Oct 2023 12:28:53 -0400 Subject: [PATCH] Backport of fix: allow snake case keys for ip based rate limit config entry into release/1.16.x (#19292) * backport of commit 5c2deeb4c6b4b3bb1a1e5eadef52fd9ee7dda99a * backport of commit e91fd9c7d7916db49c4976d29b42b29ba3ab2311 --------- Co-authored-by: Poonam Jadhav --- .changelog/_7406.txt | 3 +++ api/config_entry_rate_limit_ip.go | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changelog/_7406.txt diff --git a/.changelog/_7406.txt b/.changelog/_7406.txt new file mode 100644 index 000000000..b020a3a0e --- /dev/null +++ b/.changelog/_7406.txt @@ -0,0 +1,3 @@ +```release-note:bug +server: **(Enterprise Only)** Fixed an issue where snake case keys were rejected when configuring the control-plane-request-limit config entry +``` \ No newline at end of file diff --git a/api/config_entry_rate_limit_ip.go b/api/config_entry_rate_limit_ip.go index 8df7d4c98..7af2a2658 100644 --- a/api/config_entry_rate_limit_ip.go +++ b/api/config_entry_rate_limit_ip.go @@ -4,8 +4,8 @@ package api type ReadWriteRatesConfig struct { - ReadRate float64 - WriteRate float64 + ReadRate float64 `alias:"read_rate"` + WriteRate float64 `alias:"write_rate"` } type RateLimitIPConfigEntry struct { @@ -16,8 +16,8 @@ type RateLimitIPConfigEntry struct { Meta map[string]string `json:",omitempty"` // overall limits - ReadRate float64 - WriteRate float64 + ReadRate float64 `alias:"read_rate"` + WriteRate float64 `alias:"write_rate"` //limits specific to a type of call ACL *ReadWriteRatesConfig `json:",omitempty"` // OperationCategoryACL OperationCategory = "ACL"