public static class AccessRule.Builder extends Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
AccessRule.Builder |
action(AccessRule.Action action)
The action to take when the access criteria are met for a rule.
|
AccessRule.Builder |
blockAction(AccessRule.BlockAction blockAction)
The method used to block requests if
action is set to BLOCK and the
access criteria are met. |
AccessRule.Builder |
blockErrorPageCode(String blockErrorPageCode)
The error code to show on the error page when
action is set to BLOCK ,
blockAction is set to SHOW_ERROR_PAGE , and the access criteria are met. |
AccessRule.Builder |
blockErrorPageDescription(String blockErrorPageDescription)
The description text to show on the error page when
action is set to BLOCK , blockAction is set to SHOW_ERROR_PAGE , and the access criteria
are met. |
AccessRule.Builder |
blockErrorPageMessage(String blockErrorPageMessage)
The message to show on the error page when
action is set to BLOCK , blockAction is set to SHOW_ERROR_PAGE , and the access criteria are met. |
AccessRule.Builder |
blockResponseCode(Integer blockResponseCode)
The response status code to return when
action is set to BLOCK , blockAction is set to SET_RESPONSE_CODE , and the access criteria are met. |
AccessRule |
build() |
AccessRule.Builder |
bypassChallenges(List<AccessRule.BypassChallenges> bypassChallenges)
The list of challenges to bypass when
action is set to BYPASS . |
AccessRule.Builder |
captchaFooter(String captchaFooter)
The text to show in the footer when showing a CAPTCHA challenge when
action is
set to SHOW_CAPTCHA and the request is challenged. |
AccessRule.Builder |
captchaHeader(String captchaHeader)
The text to show in the header when showing a CAPTCHA challenge when
action is
set to SHOW_CAPTCHA and the request is challenged. |
AccessRule.Builder |
captchaSubmitLabel(String captchaSubmitLabel)
The text to show on the label of the CAPTCHA challenge submit button when
action
is set to SHOW_CAPTCHA and the request is challenged. |
AccessRule.Builder |
captchaTitle(String captchaTitle)
The title used when showing a CAPTCHA challenge when
action is set to SHOW_CAPTCHA and the request is challenged. |
AccessRule.Builder |
copy(AccessRule model) |
AccessRule.Builder |
criteria(List<AccessRuleCriteria> criteria)
The list of access rule criteria.
|
AccessRule.Builder |
name(String name)
The unique name of the access rule.
|
AccessRule.Builder |
redirectResponseCode(AccessRule.RedirectResponseCode redirectResponseCode)
The response status code to return when
action is set to REDIRECT . |
AccessRule.Builder |
redirectUrl(String redirectUrl)
The target to which the request should be redirected, represented as a URI reference.
|
AccessRule.Builder |
responseHeaderManipulation(List<HeaderManipulationAction> responseHeaderManipulation)
An object that represents an action to apply to an HTTP response headers if all rule
criteria will be matched regardless of
action value. |
public AccessRule.Builder name(String name)
The unique name of the access rule.
name
- the value to setpublic AccessRule.Builder criteria(List<AccessRuleCriteria> criteria)
The list of access rule criteria. The rule would be applied only for the requests that matched all the listed conditions.
criteria
- the value to setpublic AccessRule.Builder action(AccessRule.Action action)
The action to take when the access criteria are met for a rule. If unspecified, defaults
to ALLOW
.
- **ALLOW:** Takes no action, just logs the request.
- **DETECT:** Takes no action, but creates an alert for the request.
- **BLOCK:** Blocks the request by returning specified response code or showing error page.
- **BYPASS:** Bypasses some or all challenges.
- **REDIRECT:** Redirects the request to the specified URL. These fields are required
when REDIRECT
is selected: redirectUrl
, redirectResponseCode
.
- **SHOW_CAPTCHA:** Show a CAPTCHA Challenge page instead of the requested page.
Regardless of action, no further rules are processed once a rule is matched.
action
- the value to setpublic AccessRule.Builder blockAction(AccessRule.BlockAction blockAction)
The method used to block requests if action
is set to BLOCK
and the
access criteria are met. If unspecified, defaults to SET_RESPONSE_CODE
.
blockAction
- the value to setpublic AccessRule.Builder blockResponseCode(Integer blockResponseCode)
The response status code to return when action
is set to BLOCK
, blockAction
is set to SET_RESPONSE_CODE
, and the access criteria are met. If
unspecified, defaults to 403
. The list of available response codes: 200
,
201
, 202
, 204
, 206
, 300
, 301
, 302
, 303
, 304
, 307
, 400
, 401
, 403
,
404
, 405
, 408
, 409
, 411
, 412
, 413
, 414
, 415
, 416
, 422
, 444
, 494
,
495
, 496
, 497
, 499
, 500
, 501
, 502
, 503
, 504
, 507
.
blockResponseCode
- the value to setpublic AccessRule.Builder blockErrorPageMessage(String blockErrorPageMessage)
The message to show on the error page when action
is set to BLOCK
, blockAction
is set to SHOW_ERROR_PAGE
, and the access criteria are met. If
unspecified, defaults to ‘Access to the website is blocked.’
blockErrorPageMessage
- the value to setpublic AccessRule.Builder blockErrorPageCode(String blockErrorPageCode)
The error code to show on the error page when action
is set to BLOCK
,
blockAction
is set to SHOW_ERROR_PAGE
, and the access criteria are met.
If unspecified, defaults to ‘Access rules’.
blockErrorPageCode
- the value to setpublic AccessRule.Builder blockErrorPageDescription(String blockErrorPageDescription)
The description text to show on the error page when action
is set to BLOCK
, blockAction
is set to SHOW_ERROR_PAGE
, and the access criteria
are met. If unspecified, defaults to ‘Access blocked by website owner. Please contact
support.’
blockErrorPageDescription
- the value to setpublic AccessRule.Builder bypassChallenges(List<AccessRule.BypassChallenges> bypassChallenges)
The list of challenges to bypass when action
is set to BYPASS
. If
unspecified or empty, all challenges are bypassed.
- **JS_CHALLENGE:** Bypasses JavaScript Challenge.
- **DEVICE_FINGERPRINT_CHALLENGE:** Bypasses Device Fingerprint Challenge.
- **HUMAN_INTERACTION_CHALLENGE:** Bypasses Human Interaction Challenge.
- **CAPTCHA:** Bypasses CAPTCHA Challenge.
bypassChallenges
- the value to setpublic AccessRule.Builder redirectUrl(String redirectUrl)
The target to which the request should be redirected, represented as a URI reference.
Required when action
is REDIRECT
.
redirectUrl
- the value to setpublic AccessRule.Builder redirectResponseCode(AccessRule.RedirectResponseCode redirectResponseCode)
The response status code to return when action
is set to REDIRECT
.
- **MOVED_PERMANENTLY:** Used for designating the permanent movement of a page (numerical code - 301).
- **FOUND:** Used for designating the temporary movement of a page (numerical code - 302).
redirectResponseCode
- the value to setpublic AccessRule.Builder captchaTitle(String captchaTitle)
The title used when showing a CAPTCHA challenge when action
is set to SHOW_CAPTCHA
and the request is challenged.
captchaTitle
- the value to setpublic AccessRule.Builder captchaHeader(String captchaHeader)
The text to show in the header when showing a CAPTCHA challenge when action
is
set to SHOW_CAPTCHA
and the request is challenged.
captchaHeader
- the value to setpublic AccessRule.Builder captchaFooter(String captchaFooter)
The text to show in the footer when showing a CAPTCHA challenge when action
is
set to SHOW_CAPTCHA
and the request is challenged.
captchaFooter
- the value to setpublic AccessRule.Builder captchaSubmitLabel(String captchaSubmitLabel)
The text to show on the label of the CAPTCHA challenge submit button when action
is set to SHOW_CAPTCHA
and the request is challenged.
captchaSubmitLabel
- the value to setpublic AccessRule.Builder responseHeaderManipulation(List<HeaderManipulationAction> responseHeaderManipulation)
An object that represents an action to apply to an HTTP response headers if all rule
criteria will be matched regardless of action
value.
responseHeaderManipulation
- the value to setpublic AccessRule build()
public AccessRule.Builder copy(AccessRule model)
Copyright © 2016–2024. All rights reserved.