You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns the network address corresponding to an IP address (IPv4 or IPv6), given the provided IPv4 and IPv6 network bits (which determine the corresponding netmasks).
61
66
@@ -74,7 +79,8 @@ You can only use the `cidr()` function in [custom rules](/waf/custom-rules/) and
Returns the IPv6 network address corresponding to an IPv6 address, given the provided network bits (which determine the netmask). If you provide an IPv4 address in the first parameter, it will be returned unchanged.
80
86
@@ -95,15 +101,17 @@ You can only use the `cidr6()` function in [custom rules](/waf/custom-rules/) an
Replaces a part of a source string matched by a regular expression with a replacement string, returning the result. The replacement string can contain references to regular expression capture groups (for example, `${1}` and `${2}`), up to eight replacement references.
213
227
@@ -239,23 +253,26 @@ You can only use the `regex_replace()` function in rewrite expressions of [Trans
Returns part of the `field` value (the value of a String or Bytes [field](/ruleset-engine/rules-language/fields/)) from the `start` byte index up to (but excluding) the `end` byte index. The first byte in `field` has index `0`. If you do not provide the optional `end` index, the function returns the part of the string from `start` index to the end of the string.
261
278
@@ -274,7 +291,8 @@ substring(http.request.body.raw, 0, -2) will return "asdfgh"
274
291
275
292
### `to_string`
276
293
277
-
`to_string(Integer | Boolean | IP address)` → `String`
294
+
{/* prettier-ignore */}
295
+
<code>to_string(<Typetext="Integer | Boolean | IP address" />)</code>: <Typetext="String" />
278
296
279
297
Returns the string representation of an Integer, Boolean, or IP address value.
280
298
@@ -294,15 +312,17 @@ You can only use the `to_string()` function in rewrite expressions of [Transform
Generates a random UUIDv4 (Universally Unique Identifier, version 4) based on the given argument (a source of randomness). To obtain an array of random bytes, use the [`cf.random_seed`](/ruleset-engine/rules-language/fields/dynamic-fields/#cfrandom_seed) field.
337
358
@@ -343,7 +364,8 @@ You can only use the `uuidv4()` function in [rewrite expressions of Transform Ru
Replaces a `source` string, matched by a literal with zero or more `*` wildcard metacharacters, with a replacement string, returning the result. The replacement string can contain references to wildcard capture groups (for example, `${1}` and `${2}`), up to eight replacement references.
349
371
@@ -389,7 +411,8 @@ Currently, you can only use the `wildcard_replace()` function in rewrite express
This function looks for matches on a given slice of bits.
395
418
@@ -424,27 +447,27 @@ is_timed_hmac_valid_v0(
424
447
425
448
The `is_timed_hmac_valid_v0()` function has these parameter definitions:
426
449
427
-
-`Key`(String literal)
450
+
-`Key`<Typetext="String literal" />
428
451
429
452
- Specifies the secret cryptographic key for validating the HMAC.
430
453
431
-
-`MessageMAC`(String)
454
+
-`MessageMAC`<Typetext="String" />
432
455
433
456
- Contains a concatenation of these HMAC elements: `message`, `separator`, `timestamp`, `mac`. For a definition and an example, refer to [MessageMAC](#messagemac).
434
457
435
-
-`ttl`(Integer literal)
458
+
-`ttl`<Typetext="Integer literal" />
436
459
437
460
- Defines the time-to-live for the HMAC token, expressed in seconds. Determines how long the token is valid, relative to the time it was issued.
438
461
439
-
-`currentTimeStamp`(Integer)
462
+
-`currentTimeStamp`<Typetext="Integer" />
440
463
441
464
- Represents the UNIX timestamp when Cloudflare received the request, expressed in seconds. Pass the `http.request.timestamp.sec` field as an approximate value to this argument.
- Specifies the length of the `separator` between the `timestamp` and the `message` in the `MessageMAC`. Expressed in bytes, with a default value of `0`.
- When you set this optional argument to `'s'`, the function expects the value of the Base64-encoded `mac` in the `MessageMAC` argument to use the URL-safe character set with no padding.
0 commit comments