@@ -442,12 +442,6 @@ func routeRateLimitsPatch(vHostName string, routeName string, rateLimits []*apim
442
442
"operation" : "MERGE" ,
443
443
"value" : map [string ]interface {}{
444
444
"route" : map [string ]interface {}{
445
- "typed_per_filter_config" : map [string ]interface {}{
446
- "envoy.filters.http.ratelimit" : map [string ]interface {}{
447
- "@type" : "type.googleapis.com/envoy.extensions.filters.http.ratelimit.v3.RateLimitPerRoute" ,
448
- "vh_rate_limits" : "include" ,
449
- },
450
- },
451
445
"rate_limits" : common .EnvoyFilterRatelimitsUnstructured (rateLimits ),
452
446
},
453
447
},
@@ -502,10 +496,23 @@ func virtualHostRateLimitsPatch(vHostName string, rateLimits []*apimv1alpha1.Rat
502
496
// - request_headers:
503
497
// header_name: ":method"
504
498
// descriptor_key: "req.method"
499
+ // typed_per_filter_config:
500
+ // envoy.filters.http.ratelimit:
501
+ // @type: "type.googleapis.com/envoy.extensions.filters.http.ratelimit.v3.RateLimitPerRoute"
502
+ // vh_rate_limits: INCLUDE
505
503
patchUnstructured := map [string ]interface {}{
506
504
"operation" : "MERGE" ,
507
505
"value" : map [string ]interface {}{
508
506
"rate_limits" : common .EnvoyFilterRatelimitsUnstructured (rateLimits ),
507
+ "typed_per_filter_config" : map [string ]interface {}{
508
+ // Note the following name is different from what we have given to our pre/post-auth
509
+ // ratelimit filters. It's because you refer to the type of filter and not the name field
510
+ // of the filter. This infers it's configured for both filters in our case.
511
+ "envoy.filters.http.ratelimit" : map [string ]interface {}{
512
+ "@type" : "type.googleapis.com/envoy.extensions.filters.http.ratelimit.v3.RateLimitPerRoute" ,
513
+ "vh_rate_limits" : "INCLUDE" ,
514
+ },
515
+ },
509
516
},
510
517
}
511
518
0 commit comments