Struct aws_sdk_wafv2::types::CaptchaAction
source · #[non_exhaustive]pub struct CaptchaAction {
pub custom_request_handling: Option<CustomRequestHandling>,
}
Expand description
Specifies that WAF should run a CAPTCHA
check against the request:
-
If the request includes a valid, unexpired
CAPTCHA
token, WAF applies any custom request handling and labels that you've configured and then allows the web request inspection to proceed to the next rule, similar to aCountAction
. -
If the request doesn't include a valid, unexpired token, WAF discontinues the web ACL evaluation of the request and blocks it from going to its intended destination.
WAF generates a response that it sends back to the client, which includes the following:
-
The header
x-amzn-waf-action
with a value ofcaptcha
. -
The HTTP status code
405 Method Not Allowed
. -
If the request contains an
Accept
header with a value oftext/html
, the response includes aCAPTCHA
JavaScript page interstitial.
-
You can configure the expiration time in the CaptchaConfig
ImmunityTimeProperty
setting at the rule and web ACL level. The rule setting overrides the web ACL setting.
This action option is available for rules. It isn't available for web ACL default actions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.custom_request_handling: Option<CustomRequestHandling>
Defines custom handling for the web request, used when the CAPTCHA
inspection determines that the request's token is valid and unexpired.
For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.
Implementations§
source§impl CaptchaAction
impl CaptchaAction
sourcepub fn custom_request_handling(&self) -> Option<&CustomRequestHandling>
pub fn custom_request_handling(&self) -> Option<&CustomRequestHandling>
Defines custom handling for the web request, used when the CAPTCHA
inspection determines that the request's token is valid and unexpired.
For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.
source§impl CaptchaAction
impl CaptchaAction
sourcepub fn builder() -> CaptchaActionBuilder
pub fn builder() -> CaptchaActionBuilder
Creates a new builder-style object to manufacture CaptchaAction
.
Trait Implementations§
source§impl Clone for CaptchaAction
impl Clone for CaptchaAction
source§fn clone(&self) -> CaptchaAction
fn clone(&self) -> CaptchaAction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CaptchaAction
impl Debug for CaptchaAction
source§impl PartialEq for CaptchaAction
impl PartialEq for CaptchaAction
source§fn eq(&self, other: &CaptchaAction) -> bool
fn eq(&self, other: &CaptchaAction) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for CaptchaAction
Auto Trait Implementations§
impl Freeze for CaptchaAction
impl RefUnwindSafe for CaptchaAction
impl Send for CaptchaAction
impl Sync for CaptchaAction
impl Unpin for CaptchaAction
impl UnwindSafe for CaptchaAction
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more