Class CsrfFilterHeaplet

  • All Implemented Interfaces:
    Heaplet

    public class CsrfFilterHeaplet
    extends GenericHeaplet
    Creates and initializes a CsrfFilter supporting the injection and validation of an anti-CSRF token in the request header.

    The CsrfFilterHeaplet has the following configuration:

     {
          "type": "CsrfFilter",
          "config": {
            "cookieName"            : string       [REQUIRED - the session cookie name. ]
            "headerName"            : string       [OPTIONAL - the header used to receive the anti-CSRF token.
                                                      Defaults to "X-CSRF-Token". ]
            "excludeSafeMethods"    : boolean      [OPTIONAL - Whether or not exclude GET, HEAD and OPTION methods.
                                                      Defaults to "true". ]
            "failureHandler"        : Handler      [OPTIONAL - A handler to call when CSRF check fails.
                                                      Defaults to an empty 403 response. ]
          }
     }
     
     
    See Also:
    CsrfFilter for more details.
    • Constructor Detail

      • CsrfFilterHeaplet

        public CsrfFilterHeaplet()
    • Method Detail