Class UrlAllowListManager
java.lang.Object
ghidra.framework.client.UrlAllowListManager
UrlAllowListManager provides management of the Server URL Allow List persistent cache.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddChangeListener(ChangeListener listener) Add listener to be notified when allow list changes are made.static voidclearAccessEntry(ServerSpecification server) Clear the access entry for the specified server.static voidclearAccessEntry(URL url) Clear the access entry for the specified server URL.static voidclearAll()Clear all server access entries.static BooleanDetermine if the specified server access is allowed.static BooleanDetermine if the specified server access is allowed.static Map<ServerSpecification, AccessRecord> Returns copy of current server access map.static voidremoveChangeListener(ChangeListener listener) Remove existing change listener.static voidupdateAccess(String protocol, String host, int port, boolean allowAccess) Update the access for the specified server within the cached allow list.static voidupdateAccess(URL url, boolean allowAccess) Update the access for the specified server URL within the cached allow list.
-
Field Details
-
alwaysAllowLocalAccess
public static boolean alwaysAllowLocalAccess
-
-
Method Details
-
addChangeListener
Add listener to be notified when allow list changes are made. NOTE: This is intended for Swing use only and notification will be provided within the Swing thread.- Parameters:
listener- change listener
-
removeChangeListener
Remove existing change listener.- Parameters:
listener- change listener
-
getAccess
Determine if the specified server access is allowed. This method will return true for alllocalhost/127.0.0.1URLs ifalwaysAllowLocalAccessis true.- Parameters:
protocol- URL protocolhost- server hostport- server port- Returns:
- true if server access is allowed, false if disallowed, null if no server entry was found
-
getAccess
Determine if the specified server access is allowed. This method will return true for opaque or non-server URLs. This method will return true for alllocalhost/127.0.0.1URLs ifalwaysAllowLocalAccessis true.- Parameters:
url- server URL- Returns:
- true if server access is allowed, false if disallowed, null if no server entry was found
-
updateAccess
public static void updateAccess(String protocol, String host, int port, boolean allowAccess) throws IllegalArgumentException Update the access for the specified server within the cached allow list. Changes tolocalhost/127.0.0.1server access will be ignored ifalwaysAllowLocalAccessis true.- Parameters:
protocol- URL protocol (e.g.,https,ghidra,ghidra:<ext>).host- host name or IP addressport- connection port (positive value)allowAccess- true allows access, false disallows access- Throws:
IllegalArgumentException- if an invalid parameter is specified
-
updateAccess
Update the access for the specified server URL within the cached allow list. Changes tolocalhost/127.0.0.1server access will be ignored ifalwaysAllowLocalAccessis true.- Parameters:
url- remote server URL (local and opaque URLs not permitted)allowAccess- true allows access, false disallows access- Throws:
IllegalArgumentException- if an invalid, local or opaque URL is specified.
-
clearAccessEntry
Clear the access entry for the specified server. This is intended to be used along withgetAccessMap()for managing the existing access map. Changes tolocalhost/127.0.0.1server access will be ignored ifalwaysAllowLocalAccessis true.- Parameters:
server- server entry to be removed
-
clearAccessEntry
Clear the access entry for the specified server URL. Changes tolocalhost/127.0.0.1server access will be ignored ifalwaysAllowLocalAccessis true.- Parameters:
url- remote server URL (local and opaque URLs not permitted)
-
clearAll
public static void clearAll()Clear all server access entries. -
getAccessMap
Returns copy of current server access map.- Returns:
- copy of current server access map
-