@@ -2227,9 +2227,40 @@ message RateLimit {
22272227 option (udpa.annotations.versioning ).previous_message_type =
22282228 "envoy.api.v2.route.RateLimit.Action.GenericKey" ;
22292229
2230- // The value to use in the descriptor entry.
2230+ // Descriptor value of entry.
2231+ //
2232+ // The same :ref:`format specifier <config_access_log_format>` as used for
2233+ // :ref:`HTTP access logging <config_access_log>` applies here, however
2234+ // unknown specifier values are replaced with the empty string instead of ``-``.
2235+ //
2236+ // .. note::
2237+ //
2238+ // Formatter parsing is controlled by the runtime feature flag
2239+ // ``envoy.reloadable_features.enable_formatter_for_ratelimit_action_descriptor_value``
2240+ // (disabled by default).
2241+ //
2242+ // When enabled: The format string can contain multiple valid substitution
2243+ // fields. If multiple substitution fields are present, their results will be concatenated
2244+ // to form the final descriptor value. If it contains no substitution fields, the value
2245+ // will be used as is. If the final concatenated result is empty and ``default_value`` is set,
2246+ // the ``default_value`` will be used. If ``default_value`` is not set and the result is
2247+ // empty, this descriptor will be skipped and not included in the rate limit call.
2248+ //
2249+ // When disabled (default): The descriptor_value is used as a literal string without any formatter
2250+ // parsing or substitution.
2251+ //
2252+ // For example, ``static_value`` will be used as is since there are no substitution fields.
2253+ // ``%REQ(:method)%`` will be replaced with the HTTP method, and
2254+ // ``%REQ(:method)%%REQ(:path)%`` will be replaced with the concatenation of the HTTP method and path.
2255+ // ``%CEL(request.headers['user-id'])%`` will use CEL to extract the user ID from request headers.
2256+ //
22312257 string descriptor_value = 1 [(validate.rules ).string = {min_len : 1 }];
22322258
2259+ // An optional value to use if the final concatenated ``descriptor_value`` result is empty.
2260+ // Only applicable when formatter parsing is enabled by the runtime feature flag
2261+ // ``envoy.reloadable_features.enable_formatter_for_ratelimit_action_descriptor_value`` (disabled by default).
2262+ string default_value = 3 ;
2263+
22332264 // An optional key to use in the descriptor entry. If not set it defaults
22342265 // to 'generic_key' as the descriptor key.
22352266 string descriptor_key = 2 ;
@@ -2240,26 +2271,59 @@ message RateLimit {
22402271 // .. code-block:: cpp
22412272 //
22422273 // ("header_match", "<descriptor_value>")
2274+ // [#next-free-field: 6]
22432275 message HeaderValueMatch {
22442276 option (udpa.annotations.versioning ).previous_message_type =
22452277 "envoy.api.v2.route.RateLimit.Action.HeaderValueMatch" ;
22462278
2279+ // Descriptor value of entry.
2280+ //
2281+ // The same :ref:`format specifier <config_access_log_format>` as used for
2282+ // :ref:`HTTP access logging <config_access_log>` applies here, however
2283+ // unknown specifier values are replaced with the empty string instead of ``-``.
2284+ //
2285+ // .. note::
2286+ //
2287+ // Formatter parsing is controlled by the runtime feature flag
2288+ // ``envoy.reloadable_features.enable_formatter_for_ratelimit_action_descriptor_value``
2289+ // (disabled by default).
2290+ //
2291+ // When enabled: The format string can contain multiple valid substitution
2292+ // fields. If multiple substitution fields are present, their results will be concatenated
2293+ // to form the final descriptor value. If it contains no substitution fields, the value
2294+ // will be used as is. All substitution fields will be evaluated and their results
2295+ // concatenated. If the final concatenated result is empty and ``default_value`` is set,
2296+ // the ``default_value`` will be used. If ``default_value`` is not set and the result is
2297+ // empty, this descriptor will be skipped and not included in the rate limit call.
2298+ //
2299+ // When disabled (default): The descriptor_value is used as a literal string without any formatter
2300+ // parsing or substitution.
2301+ //
2302+ // For example, ``static_value`` will be used as is since there are no substitution fields.
2303+ // ``%REQ(:method)%`` will be replaced with the HTTP method, and
2304+ // ``%REQ(:method)%%REQ(:path)%`` will be replaced with the concatenation of the HTTP method and path.
2305+ // ``%CEL(request.headers['user-id'])%`` will use CEL to extract the user ID from request headers.
2306+ //
2307+ string descriptor_value = 1 [(validate.rules ).string = {min_len : 1 }];
2308+
2309+ // An optional value to use if the final concatenated ``descriptor_value`` result is empty.
2310+ // Only applicable when formatter parsing is enabled by the runtime feature flag
2311+ // ``envoy.reloadable_features.enable_formatter_for_ratelimit_action_descriptor_value`` (disabled by default).
2312+ string default_value = 5 ;
2313+
22472314 // The key to use in the descriptor entry.
22482315 //
22492316 // Defaults to ``header_match``.
22502317 string descriptor_key = 4 ;
22512318
2252- // The value to use in the descriptor entry.
2253- string descriptor_value = 1 [(validate.rules ).string = {min_len : 1 }];
2254-
22552319 // If set to true, the action will append a descriptor entry when the
22562320 // request matches the headers. If set to false, the action will append a
22572321 // descriptor entry when the request does not match the headers. The
22582322 // default value is true.
22592323 google.protobuf.BoolValue expect_match = 2 ;
22602324
22612325 // Specifies a set of headers that the rate limit action should match
2262- // on. The action will check the request’ s headers against all the
2326+ // on. The action will check the request' s headers against all the
22632327 // specified headers in the config. A match will happen if all the
22642328 // headers in the config are present in the request with the same values
22652329 // (or based on presence if the value field is not in the config).
@@ -2339,23 +2403,56 @@ message RateLimit {
23392403 // .. code-block:: cpp
23402404 //
23412405 // ("query_match", "<descriptor_value>")
2406+ // [#next-free-field: 6]
23422407 message QueryParameterValueMatch {
2408+ // Descriptor value of entry.
2409+ //
2410+ // The same :ref:`format specifier <config_access_log_format>` as used for
2411+ // :ref:`HTTP access logging <config_access_log>` applies here, however
2412+ // unknown specifier values are replaced with the empty string instead of ``-``.
2413+ //
2414+ // .. note::
2415+ //
2416+ // Formatter parsing is controlled by the runtime feature flag
2417+ // ``envoy.reloadable_features.enable_formatter_for_ratelimit_action_descriptor_value``
2418+ // (disabled by default).
2419+ //
2420+ // When enabled: The format string can contain multiple valid substitution
2421+ // fields. If multiple substitution fields are present, their results will be concatenated
2422+ // to form the final descriptor value. If it contains no substitution fields, the value
2423+ // will be used as is. All substitution fields will be evaluated and their results
2424+ // concatenated. If the final concatenated result is empty and ``default_value`` is set,
2425+ // the ``default_value`` will be used. If ``default_value`` is not set and the result is
2426+ // empty, this descriptor will be skipped and not included in the rate limit call.
2427+ //
2428+ // When disabled (default): The descriptor_value is used as a literal string without any formatter
2429+ // parsing or substitution.
2430+ //
2431+ // For example, ``static_value`` will be used as is since there are no substitution fields.
2432+ // ``%REQ(:method)%`` will be replaced with the HTTP method, and
2433+ // ``%REQ(:method)%%REQ(:path)%`` will be replaced with the concatenation of the HTTP method and path.
2434+ // ``%CEL(request.headers['user-id'])%`` will use CEL to extract the user ID from request headers.
2435+ //
2436+ string descriptor_value = 1 [(validate.rules ).string = {min_len : 1 }];
2437+
2438+ // An optional value to use if the final concatenated ``descriptor_value`` result is empty.
2439+ // Only applicable when formatter parsing is enabled by the runtime feature flag
2440+ // ``envoy.reloadable_features.enable_formatter_for_ratelimit_action_descriptor_value`` (disabled by default).
2441+ string default_value = 5 ;
2442+
23432443 // The key to use in the descriptor entry.
23442444 //
23452445 // Defaults to ``query_match``.
23462446 string descriptor_key = 4 ;
23472447
2348- // The value to use in the descriptor entry.
2349- string descriptor_value = 1 [(validate.rules ).string = {min_len : 1 }];
2350-
23512448 // If set to true, the action will append a descriptor entry when the
23522449 // request matches the headers. If set to false, the action will append a
23532450 // descriptor entry when the request does not match the headers. The
23542451 // default value is true.
23552452 google.protobuf.BoolValue expect_match = 2 ;
23562453
23572454 // Specifies a set of query parameters that the rate limit action should match
2358- // on. The action will check the request’ s query parameters against all the
2455+ // on. The action will check the request' s query parameters against all the
23592456 // specified query parameters in the config. A match will happen if all the
23602457 // query parameters in the config are present in the request with the same values
23612458 // (or based on presence if the value field is not in the config).
0 commit comments