public class CSRFHandlerImpl extends Object implements CSRFHandler
DEFAULT_COOKIE_NAME, DEFAULT_COOKIE_PATH, DEFAULT_HEADER_NAME, DEFAULT_RESPONSE_BODY, ERROR_MESSAGE| Constructor and Description |
|---|
CSRFHandlerImpl(String secret) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
forbidden(RoutingContext ctx) |
void |
handle(RoutingContext ctx)
Something has happened, so handle it.
|
CSRFHandler |
setCookieName(String cookieName)
Set the cookie name.
|
CSRFHandler |
setCookiePath(String cookiePath)
Set the cookie path.
|
CSRFHandler |
setHeaderName(String headerName)
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatepublic CSRFHandlerImpl(String secret)
public CSRFHandler setCookieName(String cookieName)
CSRFHandlersetCookieName in interface CSRFHandlercookieName - a new name for the cookie.public CSRFHandler setCookiePath(String cookiePath)
CSRFHandlersetCookiePath in interface CSRFHandlercookiePath - a new path for the cookie.public CSRFHandler setHeaderName(String headerName)
CSRFHandlersetHeaderName in interface CSRFHandlerheaderName - a new name for the header.public CSRFHandler setTimeout(long timeout)
CSRFHandlersetTimeout in interface CSRFHandlertimeout - token timeoutpublic CSRFHandler setNagHttps(boolean nag)
CSRFHandlersetNagHttps in interface CSRFHandlernag - true to nagpublic CSRFHandler setResponseBody(String responseBody)
CSRFHandlersetResponseBody in interface CSRFHandlerresponseBody - the body of the response. If null, no response body will be returned.protected void forbidden(RoutingContext ctx)
public void handle(RoutingContext ctx)
Handlerhandle in interface Handler<RoutingContext>ctx - the event to handleCopyright © 2020. All rights reserved.