Class LocalApiFilter

java.lang.Object
jakarta.servlet.GenericFilter
jakarta.servlet.http.HttpFilter
thredds.servlet.filter.LocalApiFilter
All Implemented Interfaces:
jakarta.servlet.Filter, jakarta.servlet.FilterConfig, Serializable

@WebFilter(urlPatterns="/local/*") public class LocalApiFilter extends jakarta.servlet.http.HttpFilter implements jakarta.servlet.Filter
Handle access to the local api of the TDS. the TDS.

This is an attempt to filter out and reject requests not originating on the same machine as the TDS. This implementation is slightly more restrictive, in that it will filter out requests not originating from the same network interface as was received by the TDS. Additionally, a time-limited, signature based authorization is used to further protect from spoofed requests. The client is responsible for managing the key, and must ensure the user running the TDS has the necessary permissions to read the key file (location defined by the tds.local.api.key property). This implementation assumes the client may update the key without informing the TDS (rotating keys are ok).

Since:
5.7
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain)
     

    Methods inherited from class jakarta.servlet.http.HttpFilter

    doFilter

    Methods inherited from class jakarta.servlet.GenericFilter

    getFilterConfig, getFilterName, getInitParameter, getInitParameterNames, getServletContext, init, init

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface jakarta.servlet.Filter

    destroy, init
  • Constructor Details

    • LocalApiFilter

      public LocalApiFilter()
  • Method Details

    • doFilter

      public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
      Specified by:
      doFilter in interface jakarta.servlet.Filter
      Overrides:
      doFilter in class jakarta.servlet.http.HttpFilter
      Throws:
      IOException
      jakarta.servlet.ServletException