public class CSRFHandler extends Object implements Handler<RoutingContext>
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<CSRFHandler> |
__TYPE_ARG |
static String |
DEFAULT_COOKIE_NAME |
static String |
DEFAULT_COOKIE_PATH |
static String |
DEFAULT_HEADER_NAME |
static String |
DEFAULT_RESPONSE_BODY |
static String |
ERROR_MESSAGE |
Constructor and Description |
---|
CSRFHandler(CSRFHandler delegate) |
CSRFHandler(Object delegate) |
Modifier and Type | Method and Description |
---|---|
static CSRFHandler |
create(String secret)
Instantiate a new CSRFHandlerImpl with a secret
|
boolean |
equals(Object o) |
CSRFHandler |
getDelegate() |
void |
handle(RoutingContext event)
Something has happened, so handle it.
|
int |
hashCode() |
static CSRFHandler |
newInstance(CSRFHandler arg) |
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.
|
String |
toString() |
public static final io.vertx.lang.rx.TypeArg<CSRFHandler> __TYPE_ARG
public static final String ERROR_MESSAGE
public static final String DEFAULT_COOKIE_NAME
public static final String DEFAULT_COOKIE_PATH
public static final String DEFAULT_HEADER_NAME
public static final String DEFAULT_RESPONSE_BODY
public CSRFHandler(CSRFHandler delegate)
public CSRFHandler(Object delegate)
public CSRFHandler getDelegate()
public void handle(RoutingContext event)
handle
in interface Handler<RoutingContext>
event
- the event to handlepublic static CSRFHandler create(String secret)
CSRFHandler.create("s3cr37")
secret
- server secret to sign the token.public CSRFHandler setCookieName(String name)
name
- a new name for the cookie.public CSRFHandler setCookiePath(String path)
path
- a new path for the cookie.public CSRFHandler setHeaderName(String name)
name
- a new name for the header.public CSRFHandler setNagHttps(boolean nag)
nag
- true to nagpublic CSRFHandler setResponseBody(String responseBody)
responseBody
- the body of the response. If null, no response body will be returned.public CSRFHandler setTimeout(long timeout)
timeout
- token timeoutpublic static CSRFHandler newInstance(CSRFHandler arg)
Copyright © 2023 Eclipse. All rights reserved.