aws_sdk_wafregional/types/_xss_match_tuple.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <note>
4/// <p>This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS WAF Classic</a> in the developer guide.</p>
5/// <p><b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints for regional and global use.</p>
6/// </note>
7/// <p>Specifies the part of a web request that you want AWS WAF to inspect for cross-site scripting attacks and, if you want AWS WAF to inspect a header, the name of the header.</p>
8#[non_exhaustive]
9#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
10pub struct XssMatchTuple {
11 /// <p>Specifies where in a web request to look for cross-site scripting attacks.</p>
12 pub field_to_match: ::std::option::Option<crate::types::FieldToMatch>,
13 /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on <code>FieldToMatch</code> before inspecting it for a match.</p>
14 /// <p>You can only specify a single type of TextTransformation.</p>
15 /// <p><b>CMD_LINE</b></p>
16 /// <p>When you're concerned that attackers are injecting an operating system command line command and using unusual formatting to disguise some or all of the command, use this option to perform the following transformations:</p>
17 /// <ul>
18 /// <li>
19 /// <p>Delete the following characters: \ " ' ^</p></li>
20 /// <li>
21 /// <p>Delete spaces before the following characters: / (</p></li>
22 /// <li>
23 /// <p>Replace the following characters with a space: , ;</p></li>
24 /// <li>
25 /// <p>Replace multiple spaces with one space</p></li>
26 /// <li>
27 /// <p>Convert uppercase letters (A-Z) to lowercase (a-z)</p></li>
28 /// </ul>
29 /// <p><b>COMPRESS_WHITE_SPACE</b></p>
30 /// <p>Use this option to replace the following characters with a space character (decimal 32):</p>
31 /// <ul>
32 /// <li>
33 /// <p>\f, formfeed, decimal 12</p></li>
34 /// <li>
35 /// <p>\t, tab, decimal 9</p></li>
36 /// <li>
37 /// <p>\n, newline, decimal 10</p></li>
38 /// <li>
39 /// <p>\r, carriage return, decimal 13</p></li>
40 /// <li>
41 /// <p>\v, vertical tab, decimal 11</p></li>
42 /// <li>
43 /// <p>non-breaking space, decimal 160</p></li>
44 /// </ul>
45 /// <p><code>COMPRESS_WHITE_SPACE</code> also replaces multiple spaces with one space.</p>
46 /// <p><b>HTML_ENTITY_DECODE</b></p>
47 /// <p>Use this option to replace HTML-encoded characters with unencoded characters. <code>HTML_ENTITY_DECODE</code> performs the following operations:</p>
48 /// <ul>
49 /// <li>
50 /// <p>Replaces <code>(ampersand)quot;</code> with <code>"</code></p></li>
51 /// <li>
52 /// <p>Replaces <code>(ampersand)nbsp;</code> with a non-breaking space, decimal 160</p></li>
53 /// <li>
54 /// <p>Replaces <code>(ampersand)lt;</code> with a "less than" symbol</p></li>
55 /// <li>
56 /// <p>Replaces <code>(ampersand)gt;</code> with <code>></code></p></li>
57 /// <li>
58 /// <p>Replaces characters that are represented in hexadecimal format, <code>(ampersand)#xhhhh;</code>, with the corresponding characters</p></li>
59 /// <li>
60 /// <p>Replaces characters that are represented in decimal format, <code>(ampersand)#nnnn;</code>, with the corresponding characters</p></li>
61 /// </ul>
62 /// <p><b>LOWERCASE</b></p>
63 /// <p>Use this option to convert uppercase letters (A-Z) to lowercase (a-z).</p>
64 /// <p><b>URL_DECODE</b></p>
65 /// <p>Use this option to decode a URL-encoded value.</p>
66 /// <p><b>NONE</b></p>
67 /// <p>Specify <code>NONE</code> if you don't want to perform any text transformations.</p>
68 pub text_transformation: crate::types::TextTransformation,
69}
70impl XssMatchTuple {
71 /// <p>Specifies where in a web request to look for cross-site scripting attacks.</p>
72 pub fn field_to_match(&self) -> ::std::option::Option<&crate::types::FieldToMatch> {
73 self.field_to_match.as_ref()
74 }
75 /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on <code>FieldToMatch</code> before inspecting it for a match.</p>
76 /// <p>You can only specify a single type of TextTransformation.</p>
77 /// <p><b>CMD_LINE</b></p>
78 /// <p>When you're concerned that attackers are injecting an operating system command line command and using unusual formatting to disguise some or all of the command, use this option to perform the following transformations:</p>
79 /// <ul>
80 /// <li>
81 /// <p>Delete the following characters: \ " ' ^</p></li>
82 /// <li>
83 /// <p>Delete spaces before the following characters: / (</p></li>
84 /// <li>
85 /// <p>Replace the following characters with a space: , ;</p></li>
86 /// <li>
87 /// <p>Replace multiple spaces with one space</p></li>
88 /// <li>
89 /// <p>Convert uppercase letters (A-Z) to lowercase (a-z)</p></li>
90 /// </ul>
91 /// <p><b>COMPRESS_WHITE_SPACE</b></p>
92 /// <p>Use this option to replace the following characters with a space character (decimal 32):</p>
93 /// <ul>
94 /// <li>
95 /// <p>\f, formfeed, decimal 12</p></li>
96 /// <li>
97 /// <p>\t, tab, decimal 9</p></li>
98 /// <li>
99 /// <p>\n, newline, decimal 10</p></li>
100 /// <li>
101 /// <p>\r, carriage return, decimal 13</p></li>
102 /// <li>
103 /// <p>\v, vertical tab, decimal 11</p></li>
104 /// <li>
105 /// <p>non-breaking space, decimal 160</p></li>
106 /// </ul>
107 /// <p><code>COMPRESS_WHITE_SPACE</code> also replaces multiple spaces with one space.</p>
108 /// <p><b>HTML_ENTITY_DECODE</b></p>
109 /// <p>Use this option to replace HTML-encoded characters with unencoded characters. <code>HTML_ENTITY_DECODE</code> performs the following operations:</p>
110 /// <ul>
111 /// <li>
112 /// <p>Replaces <code>(ampersand)quot;</code> with <code>"</code></p></li>
113 /// <li>
114 /// <p>Replaces <code>(ampersand)nbsp;</code> with a non-breaking space, decimal 160</p></li>
115 /// <li>
116 /// <p>Replaces <code>(ampersand)lt;</code> with a "less than" symbol</p></li>
117 /// <li>
118 /// <p>Replaces <code>(ampersand)gt;</code> with <code>></code></p></li>
119 /// <li>
120 /// <p>Replaces characters that are represented in hexadecimal format, <code>(ampersand)#xhhhh;</code>, with the corresponding characters</p></li>
121 /// <li>
122 /// <p>Replaces characters that are represented in decimal format, <code>(ampersand)#nnnn;</code>, with the corresponding characters</p></li>
123 /// </ul>
124 /// <p><b>LOWERCASE</b></p>
125 /// <p>Use this option to convert uppercase letters (A-Z) to lowercase (a-z).</p>
126 /// <p><b>URL_DECODE</b></p>
127 /// <p>Use this option to decode a URL-encoded value.</p>
128 /// <p><b>NONE</b></p>
129 /// <p>Specify <code>NONE</code> if you don't want to perform any text transformations.</p>
130 pub fn text_transformation(&self) -> &crate::types::TextTransformation {
131 &self.text_transformation
132 }
133}
134impl XssMatchTuple {
135 /// Creates a new builder-style object to manufacture [`XssMatchTuple`](crate::types::XssMatchTuple).
136 pub fn builder() -> crate::types::builders::XssMatchTupleBuilder {
137 crate::types::builders::XssMatchTupleBuilder::default()
138 }
139}
140
141/// A builder for [`XssMatchTuple`](crate::types::XssMatchTuple).
142#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
143#[non_exhaustive]
144pub struct XssMatchTupleBuilder {
145 pub(crate) field_to_match: ::std::option::Option<crate::types::FieldToMatch>,
146 pub(crate) text_transformation: ::std::option::Option<crate::types::TextTransformation>,
147}
148impl XssMatchTupleBuilder {
149 /// <p>Specifies where in a web request to look for cross-site scripting attacks.</p>
150 /// This field is required.
151 pub fn field_to_match(mut self, input: crate::types::FieldToMatch) -> Self {
152 self.field_to_match = ::std::option::Option::Some(input);
153 self
154 }
155 /// <p>Specifies where in a web request to look for cross-site scripting attacks.</p>
156 pub fn set_field_to_match(mut self, input: ::std::option::Option<crate::types::FieldToMatch>) -> Self {
157 self.field_to_match = input;
158 self
159 }
160 /// <p>Specifies where in a web request to look for cross-site scripting attacks.</p>
161 pub fn get_field_to_match(&self) -> &::std::option::Option<crate::types::FieldToMatch> {
162 &self.field_to_match
163 }
164 /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on <code>FieldToMatch</code> before inspecting it for a match.</p>
165 /// <p>You can only specify a single type of TextTransformation.</p>
166 /// <p><b>CMD_LINE</b></p>
167 /// <p>When you're concerned that attackers are injecting an operating system command line command and using unusual formatting to disguise some or all of the command, use this option to perform the following transformations:</p>
168 /// <ul>
169 /// <li>
170 /// <p>Delete the following characters: \ " ' ^</p></li>
171 /// <li>
172 /// <p>Delete spaces before the following characters: / (</p></li>
173 /// <li>
174 /// <p>Replace the following characters with a space: , ;</p></li>
175 /// <li>
176 /// <p>Replace multiple spaces with one space</p></li>
177 /// <li>
178 /// <p>Convert uppercase letters (A-Z) to lowercase (a-z)</p></li>
179 /// </ul>
180 /// <p><b>COMPRESS_WHITE_SPACE</b></p>
181 /// <p>Use this option to replace the following characters with a space character (decimal 32):</p>
182 /// <ul>
183 /// <li>
184 /// <p>\f, formfeed, decimal 12</p></li>
185 /// <li>
186 /// <p>\t, tab, decimal 9</p></li>
187 /// <li>
188 /// <p>\n, newline, decimal 10</p></li>
189 /// <li>
190 /// <p>\r, carriage return, decimal 13</p></li>
191 /// <li>
192 /// <p>\v, vertical tab, decimal 11</p></li>
193 /// <li>
194 /// <p>non-breaking space, decimal 160</p></li>
195 /// </ul>
196 /// <p><code>COMPRESS_WHITE_SPACE</code> also replaces multiple spaces with one space.</p>
197 /// <p><b>HTML_ENTITY_DECODE</b></p>
198 /// <p>Use this option to replace HTML-encoded characters with unencoded characters. <code>HTML_ENTITY_DECODE</code> performs the following operations:</p>
199 /// <ul>
200 /// <li>
201 /// <p>Replaces <code>(ampersand)quot;</code> with <code>"</code></p></li>
202 /// <li>
203 /// <p>Replaces <code>(ampersand)nbsp;</code> with a non-breaking space, decimal 160</p></li>
204 /// <li>
205 /// <p>Replaces <code>(ampersand)lt;</code> with a "less than" symbol</p></li>
206 /// <li>
207 /// <p>Replaces <code>(ampersand)gt;</code> with <code>></code></p></li>
208 /// <li>
209 /// <p>Replaces characters that are represented in hexadecimal format, <code>(ampersand)#xhhhh;</code>, with the corresponding characters</p></li>
210 /// <li>
211 /// <p>Replaces characters that are represented in decimal format, <code>(ampersand)#nnnn;</code>, with the corresponding characters</p></li>
212 /// </ul>
213 /// <p><b>LOWERCASE</b></p>
214 /// <p>Use this option to convert uppercase letters (A-Z) to lowercase (a-z).</p>
215 /// <p><b>URL_DECODE</b></p>
216 /// <p>Use this option to decode a URL-encoded value.</p>
217 /// <p><b>NONE</b></p>
218 /// <p>Specify <code>NONE</code> if you don't want to perform any text transformations.</p>
219 /// This field is required.
220 pub fn text_transformation(mut self, input: crate::types::TextTransformation) -> Self {
221 self.text_transformation = ::std::option::Option::Some(input);
222 self
223 }
224 /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on <code>FieldToMatch</code> before inspecting it for a match.</p>
225 /// <p>You can only specify a single type of TextTransformation.</p>
226 /// <p><b>CMD_LINE</b></p>
227 /// <p>When you're concerned that attackers are injecting an operating system command line command and using unusual formatting to disguise some or all of the command, use this option to perform the following transformations:</p>
228 /// <ul>
229 /// <li>
230 /// <p>Delete the following characters: \ " ' ^</p></li>
231 /// <li>
232 /// <p>Delete spaces before the following characters: / (</p></li>
233 /// <li>
234 /// <p>Replace the following characters with a space: , ;</p></li>
235 /// <li>
236 /// <p>Replace multiple spaces with one space</p></li>
237 /// <li>
238 /// <p>Convert uppercase letters (A-Z) to lowercase (a-z)</p></li>
239 /// </ul>
240 /// <p><b>COMPRESS_WHITE_SPACE</b></p>
241 /// <p>Use this option to replace the following characters with a space character (decimal 32):</p>
242 /// <ul>
243 /// <li>
244 /// <p>\f, formfeed, decimal 12</p></li>
245 /// <li>
246 /// <p>\t, tab, decimal 9</p></li>
247 /// <li>
248 /// <p>\n, newline, decimal 10</p></li>
249 /// <li>
250 /// <p>\r, carriage return, decimal 13</p></li>
251 /// <li>
252 /// <p>\v, vertical tab, decimal 11</p></li>
253 /// <li>
254 /// <p>non-breaking space, decimal 160</p></li>
255 /// </ul>
256 /// <p><code>COMPRESS_WHITE_SPACE</code> also replaces multiple spaces with one space.</p>
257 /// <p><b>HTML_ENTITY_DECODE</b></p>
258 /// <p>Use this option to replace HTML-encoded characters with unencoded characters. <code>HTML_ENTITY_DECODE</code> performs the following operations:</p>
259 /// <ul>
260 /// <li>
261 /// <p>Replaces <code>(ampersand)quot;</code> with <code>"</code></p></li>
262 /// <li>
263 /// <p>Replaces <code>(ampersand)nbsp;</code> with a non-breaking space, decimal 160</p></li>
264 /// <li>
265 /// <p>Replaces <code>(ampersand)lt;</code> with a "less than" symbol</p></li>
266 /// <li>
267 /// <p>Replaces <code>(ampersand)gt;</code> with <code>></code></p></li>
268 /// <li>
269 /// <p>Replaces characters that are represented in hexadecimal format, <code>(ampersand)#xhhhh;</code>, with the corresponding characters</p></li>
270 /// <li>
271 /// <p>Replaces characters that are represented in decimal format, <code>(ampersand)#nnnn;</code>, with the corresponding characters</p></li>
272 /// </ul>
273 /// <p><b>LOWERCASE</b></p>
274 /// <p>Use this option to convert uppercase letters (A-Z) to lowercase (a-z).</p>
275 /// <p><b>URL_DECODE</b></p>
276 /// <p>Use this option to decode a URL-encoded value.</p>
277 /// <p><b>NONE</b></p>
278 /// <p>Specify <code>NONE</code> if you don't want to perform any text transformations.</p>
279 pub fn set_text_transformation(mut self, input: ::std::option::Option<crate::types::TextTransformation>) -> Self {
280 self.text_transformation = input;
281 self
282 }
283 /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on <code>FieldToMatch</code> before inspecting it for a match.</p>
284 /// <p>You can only specify a single type of TextTransformation.</p>
285 /// <p><b>CMD_LINE</b></p>
286 /// <p>When you're concerned that attackers are injecting an operating system command line command and using unusual formatting to disguise some or all of the command, use this option to perform the following transformations:</p>
287 /// <ul>
288 /// <li>
289 /// <p>Delete the following characters: \ " ' ^</p></li>
290 /// <li>
291 /// <p>Delete spaces before the following characters: / (</p></li>
292 /// <li>
293 /// <p>Replace the following characters with a space: , ;</p></li>
294 /// <li>
295 /// <p>Replace multiple spaces with one space</p></li>
296 /// <li>
297 /// <p>Convert uppercase letters (A-Z) to lowercase (a-z)</p></li>
298 /// </ul>
299 /// <p><b>COMPRESS_WHITE_SPACE</b></p>
300 /// <p>Use this option to replace the following characters with a space character (decimal 32):</p>
301 /// <ul>
302 /// <li>
303 /// <p>\f, formfeed, decimal 12</p></li>
304 /// <li>
305 /// <p>\t, tab, decimal 9</p></li>
306 /// <li>
307 /// <p>\n, newline, decimal 10</p></li>
308 /// <li>
309 /// <p>\r, carriage return, decimal 13</p></li>
310 /// <li>
311 /// <p>\v, vertical tab, decimal 11</p></li>
312 /// <li>
313 /// <p>non-breaking space, decimal 160</p></li>
314 /// </ul>
315 /// <p><code>COMPRESS_WHITE_SPACE</code> also replaces multiple spaces with one space.</p>
316 /// <p><b>HTML_ENTITY_DECODE</b></p>
317 /// <p>Use this option to replace HTML-encoded characters with unencoded characters. <code>HTML_ENTITY_DECODE</code> performs the following operations:</p>
318 /// <ul>
319 /// <li>
320 /// <p>Replaces <code>(ampersand)quot;</code> with <code>"</code></p></li>
321 /// <li>
322 /// <p>Replaces <code>(ampersand)nbsp;</code> with a non-breaking space, decimal 160</p></li>
323 /// <li>
324 /// <p>Replaces <code>(ampersand)lt;</code> with a "less than" symbol</p></li>
325 /// <li>
326 /// <p>Replaces <code>(ampersand)gt;</code> with <code>></code></p></li>
327 /// <li>
328 /// <p>Replaces characters that are represented in hexadecimal format, <code>(ampersand)#xhhhh;</code>, with the corresponding characters</p></li>
329 /// <li>
330 /// <p>Replaces characters that are represented in decimal format, <code>(ampersand)#nnnn;</code>, with the corresponding characters</p></li>
331 /// </ul>
332 /// <p><b>LOWERCASE</b></p>
333 /// <p>Use this option to convert uppercase letters (A-Z) to lowercase (a-z).</p>
334 /// <p><b>URL_DECODE</b></p>
335 /// <p>Use this option to decode a URL-encoded value.</p>
336 /// <p><b>NONE</b></p>
337 /// <p>Specify <code>NONE</code> if you don't want to perform any text transformations.</p>
338 pub fn get_text_transformation(&self) -> &::std::option::Option<crate::types::TextTransformation> {
339 &self.text_transformation
340 }
341 /// Consumes the builder and constructs a [`XssMatchTuple`](crate::types::XssMatchTuple).
342 /// This method will fail if any of the following fields are not set:
343 /// - [`text_transformation`](crate::types::builders::XssMatchTupleBuilder::text_transformation)
344 pub fn build(self) -> ::std::result::Result<crate::types::XssMatchTuple, ::aws_smithy_types::error::operation::BuildError> {
345 ::std::result::Result::Ok(crate::types::XssMatchTuple {
346 field_to_match: self.field_to_match,
347 text_transformation: self.text_transformation.ok_or_else(|| {
348 ::aws_smithy_types::error::operation::BuildError::missing_field(
349 "text_transformation",
350 "text_transformation was not specified but it is required when building XssMatchTuple",
351 )
352 })?,
353 })
354 }
355}