public interface CSRFHandler extends Handler<RoutingContext>
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_COOKIE_NAME |
static String |
DEFAULT_COOKIE_PATH |
static String |
DEFAULT_HEADER_NAME |
static String |
DEFAULT_RESPONSE_BODY |
static String |
ERROR_MESSAGE |
Modifier and Type | Method and Description |
---|---|
static CSRFHandler |
create(String secret)
Instantiate a new CSRFHandlerImpl with a secret
|
CSRFHandler |
setCookieName(String name)
Set the cookie name.
|
CSRFHandler |
setCookiePath(String path)
Set the cookie path.
|
CSRFHandler |
setHeaderName(String name)
Set the header name.
|
CSRFHandler |
setNagHttps(boolean nag)
Should the handler give warning messages if this handler is used in other than https protocols?
|
CSRFHandler |
setResponseBody(String responseBody)
Set the body returned by the handler when the XSRF token is missing or invalid.
|
CSRFHandler |
setTimeout(long timeout)
Set the timeout for tokens generated by the handler, by default it uses the default from the session handler.
|
static final String ERROR_MESSAGE
static final String DEFAULT_COOKIE_NAME
static final String DEFAULT_COOKIE_PATH
static final String DEFAULT_HEADER_NAME
static final String DEFAULT_RESPONSE_BODY
static CSRFHandler create(String secret)
CSRFHandler.create("s3cr37")
secret
- server secret to sign the token.CSRFHandler setCookieName(String name)
name
- a new name for the cookie.CSRFHandler setCookiePath(String path)
path
- a new path for the cookie.CSRFHandler setHeaderName(String name)
name
- a new name for the header.CSRFHandler setNagHttps(boolean nag)
nag
- true to nagCSRFHandler setResponseBody(String responseBody)
responseBody
- the body of the response. If null, no response body will be returned.CSRFHandler setTimeout(long timeout)
timeout
- token timeoutCopyright © 2023 Eclipse. All rights reserved.