fix(controller): Allow wildcard resources with specific actions in rate limit config (#6550)
* Wildcard API rate limit added * changes updated * reviwed changes added
This commit is contained in:
1 parent
f735676657
commit
c1283c2875
3 files changed
+156
-1
No files matched your search
@@ -137,6 +137,25 @@ func TestController_initializeRateLimiter(t *testing.T) {
|
||||
false,
|
||||
nil,
|
||||
},
|
||||
{
|
||||
"wildcardReadList",
|
||||
&config.Config{
|
||||
Controller: &config.Controller{
|
||||
ApiRateLimits: ratelimit.Configs{
|
||||
{
|
||||
Resources: []string{"*"},
|
||||
Actions: []string{"read", "list"},
|
||||
Per: "total",
|
||||
Limit: 100,
|
||||
Period: time.Minute,
|
||||
},
|
||||
},
|
||||
ApiRateLimiterMaxQuotas: ratelimit.DefaultLimiterMaxQuotas(),
|
||||
},
|
||||
},
|
||||
false,
|
||||
nil,
|
||||
},
|
||||
{
|
||||
"invalid",
|
||||
&config.Config{
|
||||
|
||||
Reference in new issue
Block a user