public class CSRFHandlerImpl extends Object implements CSRFHandler
DEFAULT_COOKIE_NAME, DEFAULT_COOKIE_PATH, DEFAULT_HEADER_NAME| Constructor and Description |
|---|
CSRFHandlerImpl(Vertx vertx,
String secret) |
| Modifier and Type | Method and Description |
|---|---|
void |
handle(RoutingContext ctx)
Something has happened, so handle it.
|
CSRFHandler |
setCookieHttpOnly(boolean httpOnly)
Set the cookie
httpOnly attribute. |
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 |
setOrigin(String origin)
Set the origin for this server.
|
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 CSRFHandler setOrigin(String origin)
CSRFHandlersetOrigin in interface CSRFHandlerorigin - the origin for this server e.g.: https://www.foo.com.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 setCookieHttpOnly(boolean httpOnly)
CSRFHandlerhttpOnly attribute. When setting to false the CSRF handler will behave in
Double Submit Cookie mode. When set to true then it will operate in Cookie-to-header mode.
For more information https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#double-submit-cookiesetCookieHttpOnly in interface CSRFHandlerhttpOnly - a new name for the header.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 void handle(RoutingContext ctx)
Handlerhandle in interface Handler<RoutingContext>ctx - the event to handleCopyright © 2021. All rights reserved.