From 2bd38d88064db3ad1460f1a49f788e049f32ffb2 Mon Sep 17 00:00:00 2001 From: Poonam Jadhav Date: Thu, 19 Oct 2023 10:54:00 -0400 Subject: [PATCH] fix: allow snake case keys for ip based rate limit config entry (#19277) * fix: allow snake case keys for ip based rate limit config entry * chore: add changelog --- .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 0000000000..b020a3a0e6 --- /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 8df7d4c98e..7af2a2658f 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"