Interface EgressFilter

All Known Implementing Classes:
EgressFilterSequence, RegexEgressFilter

public interface EgressFilter
An interface which can be used to limit access to a resource at a particular URL. This can be set on the ReportFactory via ReportFactory.setEgressFilter(org.faceless.publisher.type.EgressFilter)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final EgressFilter
    An EgressFilter that allows all URLs, unchanged.
    static final boolean
     
    static final EgressFilter
    The default EgressFilter used by BFO Publisher.
    static final EgressFilter
    An EgressFilter that allows only potentially trustworthy URLs - data, about and some other schemes used internally by BFO Publisher that are required for normal function.
    static final EgressFilter
    An EgressFilter that disallows access to any file URL, but is otherwise like DEFAULT
    static final EgressFilter
    An EgressFilter that disallows access to any local network URL, such as http://127.0.0.1, http://192.168.0.1, http://server.local, http://server, http://[::1], http://[fd02::1] or http://169.254.0.1.
  • Method Summary

    Modifier and Type
    Method
    Description
    rewrite(URL2 uri, URL2 src)
    This method will be supplied with the URL about to be loaded, and the base URL of the Document loading it.
  • Field Details

    • DEBUG

      static final boolean DEBUG
    • ALWAYS

      static final EgressFilter ALWAYS
      An EgressFilter that allows all URLs, unchanged. This would present a security risk if used - for instance, a web-page could include file:///etc/passwd in its output.
    • NEVER

      static final EgressFilter NEVER
      An EgressFilter that allows only potentially trustworthy URLs - data, about and some other schemes used internally by BFO Publisher that are required for normal function.
    • NOFILES

      static final EgressFilter NOFILES
      An EgressFilter that disallows access to any file URL, but is otherwise like DEFAULT
    • NOLOCAL

      static final EgressFilter NOLOCAL
      An EgressFilter that disallows access to any local network URL, such as http://127.0.0.1, http://192.168.0.1, http://server.local, http://server, http://[::1], http://[fd02::1] or http://169.254.0.1.
    • DEFAULT

      static final EgressFilter DEFAULT
      The default EgressFilter used by BFO Publisher. This has the following restrictions:
      • special URLs such as those with the schemes about: or data: can always be accessed
      • file and jar URLs can only ever be accessed from file and jar URLs
      • local-network URLs (eg 192.168.1.1) can only ever be accessed from local-network URLs
      • otherwise all access is allowed
  • Method Details

    • rewrite

      URL2 rewrite(URL2 uri, URL2 src)
      This method will be supplied with the URL about to be loaded, and the base URL of the Document loading it. It can return the URL as it is to load it, a rewritten URL to load a new resource instead, or null to disallow the load.
      Parameters:
      uri - the destination URL
      src - the URL of the document, or null if we're testing the base URL of the document
      Returns:
      the URL to load, or null to disallow access