Skip to content

Commit ac190f9

Browse files
committed
Clarify example usage and example value in other pages
1 parent 4d584dd commit ac190f9

File tree

5 files changed

+137
-125
lines changed

5 files changed

+137
-125
lines changed

src/content/docs/ruleset-engine/rules-language/fields/dynamic-fields.mdx

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Indicates whether the visitor has previously passed a JS Detection. For more det
9494

9595
List of IDs that correlate to the Bot Management heuristic detections made on a request (you can have multiple heuristic detections on the same request). Use this field to explicitly match a specific heuristic or to exclude a heuristic in a rule.
9696

97-
Example:
97+
Example usage:
9898

9999
```txt
100100
any(cf.bot_management.detection_ids[*] eq 33554817)
@@ -148,7 +148,7 @@ Represents a Cloudflare threat score from 0–100, where 0 indicates low risk. V
148148

149149
The cipher for the connection to Cloudflare.
150150

151-
Example:
151+
Example value:
152152

153153
```txt
154154
"AES128-SHA256"
@@ -178,7 +178,7 @@ Returns `true` when a request presents a certificate (valid or not).
178178

179179
The Distinguished Name (DN) of the Certificate Authority (CA) that issued the certificate included in the request.
180180

181-
Example:
181+
Example value:
182182

183183
```txt
184184
"CN=Access Testing CA,OU=TX,O=Access Testing,L=Austin,ST=Texas,C=US"
@@ -190,7 +190,7 @@ Example:
190190

191191
The Distinguished Name (DN) of the owner (or requester) of the certificate included in the request.
192192

193-
Example:
193+
Example value:
194194

195195
```txt
196196
"CN=James Royal,OU=Access Admins,O=Access,L=Austin,ST=Texas,C=US"
@@ -202,9 +202,9 @@ Example:
202202

203203
The Distinguished Name (DN) of the Certificate Authority (CA) that issued the certificate in the request in [RFC 2253](https://datatracker.ietf.org/doc/html/rfc2253) format.
204204

205-
Example:
205+
Example value:
206206

207-
```
207+
```txt
208208
"CN=Access Testing CA,OU=TX,O=Access Testing,L=Austin,ST=Texas,C=US"
209209
```
210210

@@ -214,9 +214,9 @@ Example:
214214

215215
The Distinguished Name (DN) of the owner (or requester) of the certificate in the request in [RFC 2253](https://datatracker.ietf.org/doc/html/rfc2253) format.
216216

217-
Example:
217+
Example value:
218218

219-
```
219+
```txt
220220
"CN=James Royal,OU=Access Admins,O=Access,L=Austin,ST=Texas,C=US"
221221
```
222222

@@ -226,9 +226,9 @@ Example:
226226

227227
The Distinguished Name (DN) of the Certificate Authority (CA) that issued the certificate in the request in a legacy format.
228228

229-
Example:
229+
Example value:
230230

231-
```
231+
```txt
232232
"/C=US/ST=Texas/L=Austin/O=Access Testing/OU=TX/CN=Access Testing CA"
233233
```
234234

@@ -238,9 +238,9 @@ Example:
238238

239239
The Distinguished Name (DN) of the owner (or requester) of the certificate in the request in a legacy format.
240240

241-
Example:
241+
Example value:
242242

243-
```
243+
```txt
244244
"/C=US/ST=Texas/L=Austin/O=Access/OU=Access Admins/CN=James Royal"
245245
```
246246

@@ -250,9 +250,9 @@ Example:
250250

251251
Serial number of the certificate in the request.
252252

253-
Example:
253+
Example value:
254254

255-
```
255+
```txt
256256
"527E0F20A20EA2A4146C78390F34CE7AF0878CA4"
257257
```
258258

@@ -262,9 +262,9 @@ Example:
262262

263263
Serial number of the direct issuer of the certificate in the request.
264264

265-
Example:
265+
Example value:
266266

267-
```
267+
```txt
268268
"2688201DBA77402EA87118876F2E1B24CF8B0395"
269269
```
270270

@@ -274,9 +274,9 @@ Example:
274274

275275
The SHA-256 fingerprint of the certificate in the request.
276276

277-
Example:
277+
Example value:
278278

279-
```
279+
```txt
280280
"af363dc85bc942a892d3cee9796190fdb36d89cd588a4f1cb17c74a943439714"
281281
```
282282

@@ -286,9 +286,9 @@ Example:
286286

287287
The SHA-1 fingerprint of the certificate in the request.
288288

289-
Example:
289+
Example value:
290290

291-
```
291+
```txt
292292
"933ad5282c560ae3f482a43ecd73bc9de878a190"
293293
```
294294

@@ -298,9 +298,9 @@ Example:
298298

299299
The certificate in the request is not valid before this date.
300300

301-
Example:
301+
Example value:
302302

303-
```
303+
```txt
304304
"Mar 21 13:35:00 2022 GMT"
305305
```
306306

@@ -310,9 +310,9 @@ Example:
310310

311311
The certificate in the request is not valid after this date.
312312

313-
Example:
313+
Example value:
314314

315-
```
315+
```txt
316316
"Mar 21 13:35:00 2023 GMT"
317317
```
318318

@@ -322,9 +322,9 @@ Example:
322322

323323
The Subject Key Identifier (SKI) of the certificate in the request.
324324

325-
Example:
325+
Example value:
326326

327-
```
327+
```txt
328328
"27846FAE6EAC4A8DAD9101B519CF1EB460242831"
329329
```
330330

@@ -334,9 +334,9 @@ Example:
334334

335335
The Subject Key Identifier (SKI) of the direct issuer of the certificate in the request.
336336

337-
Example:
337+
Example value:
338338

339-
```
339+
```txt
340340
"8204924CF49D471E855862706D889F58F6B784D3"
341341
```
342342

@@ -346,9 +346,9 @@ Example:
346346

347347
The SHA-1 fingerprint of TLS client extensions, encoded in Base64.
348348

349-
Example:
349+
Example value:
350350

351-
```
351+
```txt
352352
"OWFiM2I5ZDc0YWI0YWYzZmFkMGU0ZjhlYjhiYmVkMjgxNTU5YTU2Mg=="
353353
```
354354

@@ -358,9 +358,9 @@ Example:
358358

359359
The length of the client hello message sent in a [TLS handshake](https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake). Specifically, the length of the bytestring of the client hello.
360360

361-
Example:
361+
Example value:
362362

363-
```
363+
```txt
364364
508
365365
```
366366

@@ -370,9 +370,9 @@ Example:
370370

371371
The value of the 32-byte random value provided by the client in a [TLS handshake](https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake), encoded in Base64. Refer to [RFC 8446](https://datatracker.ietf.org/doc/html/rfc8446#section-4.1.2) for more details.
372372

373-
Example:
373+
Example value:
374374

375-
```
375+
```txt
376376
"YWJjZA=="
377377
```
378378

@@ -382,9 +382,9 @@ Example:
382382

383383
The TLS version of the connection to Cloudflare.
384384

385-
Example:
385+
Example value:
386386

387-
```
387+
```txt
388388
"TLSv1.2"
389389
```
390390

src/content/docs/ruleset-engine/rules-language/fields/http-request-header.mdx

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The request header values are not pre-processed and retain the original case use
3030
- **Whitespace:** preserved
3131
- **Non-ASCII:** preserved
3232

33-
Example:
33+
Example usage:
3434

3535
```txt
3636
any(http.request.headers["content-type"][*] == "application/json")
@@ -62,9 +62,9 @@ Duplicate headers are listed multiple times.
6262
- **Whitespace:** preserved
6363
- **Non-ASCII:** preserved
6464

65-
Example:
65+
Example usage:
6666

67-
```
67+
```txt
6868
any(http.request.headers.names[*] == "content-type")
6969
```
7070

@@ -86,30 +86,30 @@ Duplicate headers are listed multiple times.
8686
- **Whitespace:** preserved
8787
- **Non-ASCII:** preserved
8888

89-
Example 1:
89+
Example value 1:
9090

91-
```
92-
any(http.request.headers.values[*] == "application/json")
91+
```txt
92+
["application/json"]
9393
```
9494

95-
Example value 1:
95+
Example usage 1:
9696

97-
```
98-
["application/json"]
97+
```txt
98+
any(http.request.headers.values[*] == "application/json")
9999
```
100100

101101
Additionally used to match requests according to the specified operator and the length/size entered for the header value.
102102

103-
Example 2:
103+
Example value 2:
104104

105-
```
106-
any(len(http.request.headers.values[*])[*] gt 10)
105+
```txt
106+
["This header value is longer than 10 bytes"]
107107
```
108108

109-
Example value 2:
109+
Example usage 2:
110110

111-
```
112-
["This header value is longer than 10 bytes"]
111+
```txt
112+
any(len(http.request.headers.values[*])[*] gt 10)
113113
```
114114

115115
## `http.request.headers.truncated`
@@ -133,13 +133,19 @@ If the HTTP header includes the language tag `*` it will not be stored in the ar
133133
Example 1:
134134

135135
Request with header `Accept-Language: fr-CH, fr;q=0.8, en;q=0.9, de;q=0.7, *;q=0.5`. In this case:
136-
`http.request.accepted_languages[0] == "fr-CH"`
137-
`http.request.accepted_languages == ["fr-CH", "en", "fr", "de"]`
136+
137+
```txt
138+
http.request.accepted_languages[0] ==> "fr-CH"
139+
http.request.accepted_languages ==> ["fr-CH", "en", "fr", "de"]
140+
```
138141

139142
Example 2:
140143

141144
Request without an `Accept-Language` HTTP header and a URI of `https://www.example.com/my-path`. In this case:
142-
`concat("/", http.request.accepted_languages[0], http.request.uri.path) == "//my-path"`.
145+
146+
```txt
147+
concat("/", http.request.accepted_languages[0], http.request.uri.path) ==> "//my-path"
148+
```
143149

144150
:::note
145151
This field is only available in [Transform Rules](/rules/transform/).

0 commit comments

Comments
 (0)