Class ResourceIsolationRequestCycleListener

    • Method Detail

      • setErrorCode

        public ResourceIsolationRequestCycleListener setErrorCode​(int errorCode)
        Modifies the HTTP error code in the exception when a disallowed request is detected.
        Parameters:
        errorCode - the alternate HTTP error code, default 403 FORBIDDEN
        Returns:
        this
      • setErrorMessage

        public ResourceIsolationRequestCycleListener setErrorMessage​(String errorMessage)
        Modifies the HTTP message in the exception when a disallowed request is detected.
        Parameters:
        errorMessage - the alternate message
        Returns:
        this
      • addExemptedPaths

        public void addExemptedPaths​(String... exemptions)
      • isEnabled

        protected boolean isEnabled()
        Dynamic override for enabling/disabling the CSRF detection. Might be handy for specific tenants in a multi-tenant application. When false, the CSRF detection is not performed for the running request. Default true
        Returns:
        true when the CSRF checks need to be performed.
      • isChecked

        protected boolean isChecked​(IRequestablePage targetedPage)
        Override to limit whether the request to the specific page should be checked for a possible CSRF attack.
        Parameters:
        targetedPage - the page that is the target for the action
        Returns:
        true when the request to the page should be checked for CSRF issues.
      • isChecked

        protected boolean isChecked​(org.apache.wicket.request.IRequestHandler handler)
        Override to change the request handler types that are checked. Currently only action handlers (form submits, link clicks, AJAX events) are checked.
        Parameters:
        handler - the handler that is currently processing
        Returns:
        true when resource isolation should be checked for this handler