Class HTTPRequestValidationHandler

All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, MessageHandler

@Deprecated(forRemoval=true, since="4.3") public class HTTPRequestValidationHandler extends AbstractMessageHandler
Deprecated, for removal: This API element is subject to removal in a future version.
A message handler that checks basic HTTP request properties.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Supplier<javax.servlet.http.HttpServletRequest>
    Deprecated, for removal: This API element is subject to removal in a future version.
    The HTTP servlet request being evaluated.
    private final org.slf4j.Logger
    Deprecated, for removal: This API element is subject to removal in a future version.
    Class logger.
    private String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Expected content type of the request.
    private String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Expected method of the request.
    private boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Whether the request must be secure.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    protected void
    doInvoke(MessageContext messageContext)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Evaluates whether the specified HTTP servlet request meets all requirements.
    protected void
    evaluateContentType(javax.servlet.http.HttpServletRequest request)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks if the request is of the correct content type.
    protected void
    evaluateRequestMethod(javax.servlet.http.HttpServletRequest request)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks if the request contains the correct request method.
    protected void
    evaluateSecured(javax.servlet.http.HttpServletRequest request)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks if the request is secured.
    javax.servlet.http.HttpServletRequest
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the HTTP servlet request instance being evaluated.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the required content type.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the required request method.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get whether request is required to be secure.
    void
    setHttpServletRequest(javax.servlet.http.HttpServletRequest request)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the HTTP servlet request instance being evaluated.
    void
    setHttpServletRequestSupplier(Supplier<javax.servlet.http.HttpServletRequest> requestSupplier)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the HTTP servlet request supplier
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the required content type.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the required request method.
    void
    setRequireSecured(boolean secured)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set whether request is required to be secure.

    Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent

    destroy, doDestroy, initialize, isDestroyed, isInitialized

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent

    initialize, isInitialized
  • Field Details

    • log

      @Nonnull private final org.slf4j.Logger log
      Deprecated, for removal: This API element is subject to removal in a future version.
      Class logger.
    • requiredContentType

      @Nullable private String requiredContentType
      Deprecated, for removal: This API element is subject to removal in a future version.
      Expected content type of the request.
    • requiredRequestMethod

      @Nullable private String requiredRequestMethod
      Deprecated, for removal: This API element is subject to removal in a future version.
      Expected method of the request.
    • requireSecured

      private boolean requireSecured
      Deprecated, for removal: This API element is subject to removal in a future version.
      Whether the request must be secure.
    • httpServletRequestSupplier

      @NonnullAfterInit private Supplier<javax.servlet.http.HttpServletRequest> httpServletRequestSupplier
      Deprecated, for removal: This API element is subject to removal in a future version.
      The HTTP servlet request being evaluated.
  • Constructor Details

    • HTTPRequestValidationHandler

      public HTTPRequestValidationHandler()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getRequiredContentType

      public String getRequiredContentType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the required content type.
      Returns:
      the required content type
    • setRequiredContentType

      public void setRequiredContentType(String contentType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the required content type.
      Parameters:
      contentType - the content type
    • getRequiredRequestMethod

      public String getRequiredRequestMethod()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the required request method.
      Returns:
      the required request method
    • setRequiredRequestMethod

      public void setRequiredRequestMethod(String requestMethod)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the required request method.
      Parameters:
      requestMethod - the required request method
    • isRequireSecured

      public boolean isRequireSecured()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get whether request is required to be secure.
      Returns:
      true if required to be secure, false otherwise
    • setRequireSecured

      public void setRequireSecured(boolean secured)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set whether request is required to be secure.
      Parameters:
      secured - true if required to be secure, false otherwise
    • getHttpServletRequest

      @NonnullAfterInit public javax.servlet.http.HttpServletRequest getHttpServletRequest()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the HTTP servlet request instance being evaluated.
      Returns:
      returns the request instance
    • setHttpServletRequest

      public void setHttpServletRequest(javax.servlet.http.HttpServletRequest request)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the HTTP servlet request instance being evaluated.
      Parameters:
      request - the request instance
    • setHttpServletRequestSupplier

      public void setHttpServletRequestSupplier(Supplier<javax.servlet.http.HttpServletRequest> requestSupplier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the HTTP servlet request supplier
      Parameters:
      requestSupplier - the supplier for the request instance
    • doInitialize

      protected void doInitialize() throws ComponentInitializationException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      doInitialize in class AbstractInitializableComponent
      Throws:
      ComponentInitializationException
    • doInvoke

      protected void doInvoke(MessageContext messageContext) throws MessageHandlerException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Evaluates whether the specified HTTP servlet request meets all requirements.
      Specified by:
      doInvoke in class AbstractMessageHandler
      Parameters:
      messageContext - message context being evaluated
      Throws:
      MessageHandlerException - thrown if the request does not meet the requirements of the handler
    • evaluateContentType

      protected void evaluateContentType(javax.servlet.http.HttpServletRequest request) throws MessageHandlerException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks if the request is of the correct content type.
      Parameters:
      request - the request being evaluated
      Throws:
      MessageHandlerException - thrown if the content type was an unexpected value
    • evaluateRequestMethod

      protected void evaluateRequestMethod(javax.servlet.http.HttpServletRequest request) throws MessageHandlerException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks if the request contains the correct request method.
      Parameters:
      request - the request being evaluated
      Throws:
      MessageHandlerException - thrown if the request method was an unexpected value
    • evaluateSecured

      protected void evaluateSecured(javax.servlet.http.HttpServletRequest request) throws MessageHandlerException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks if the request is secured.
      Parameters:
      request - the request being evaluated
      Throws:
      MessageHandlerException - thrown if the request is not secure and was required to be