Class AbstractUrlAllowListProvider

java.lang.Object
ghidra.framework.client.AbstractUrlAllowListProvider
All Implemented Interfaces:
UrlAllowListProvider
Direct Known Subclasses:
DefaultGhidraUrlAllowListProvider

public abstract class AbstractUrlAllowListProvider extends Object implements UrlAllowListProvider
AbstractUrlAllowListProvider provides the abstract URL allow list provider.

NOTE: See UrlAllowListManager for persistent allow list which will be consulted before prompting user and updated if user allows access.

  • Constructor Details

    • AbstractUrlAllowListProvider

      public AbstractUrlAllowListProvider()
  • Method Details

    • accessAllowed

      protected static Boolean accessAllowed(URL url)
      Determine if access has previously been determined and return access state. This method will return true for opaque or non-server URLs.
      Parameters:
      url - server URL
      Returns:
      true if access allowed or URL type is not handled by allow list, false if access is disallowed, or null if no allow list entry exists.
    • getPort

      protected static int getPort(URL url)
      Get the port to be accessed by the specified URL. If not specified, the default port will be returned.
      Parameters:
      url - server URL
      Returns:
      URL port
    • getBaseURL

      protected static String getBaseURL(URL url) throws IllegalArgumentException
      Get the base URL form which only includes protocol, server and port.
      Parameters:
      url - server URL
      Returns:
      simplified base URL (e.g., ghidra://host/repo )
      Throws:
      IllegalArgumentException - if URL does not specify an authority