fix: allow additional trusted Feature Service hosts for ArcGIS plugin#5
Open
cstirry wants to merge 1 commit into
Open
fix: allow additional trusted Feature Service hosts for ArcGIS plugin#5cstirry wants to merge 1 commit into
cstirry wants to merge 1 commit into
Conversation
Author
|
Need to update whatever README is relevant for this |
Author
|
This approach could definitely be better. For example, at plugin startup, call |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The ArcGIS plugin's _validate_feature_url method only trusts Feature Service URLs hosted on *.arcgis.com or the configured portal_url domain. DC's open data portal (opendata.dc.gov) serves dataset metadata via the Hub API, but the actual Feature Services are hosted on
maps2.dcgis.dc.gov— a separate domain. This causes query_data to fail with warnings like:"Feature service URL host '
maps2.dcgis.dc.gov' is not within allowed domains (*.arcgis.com or opendata.dc.gov)"Fix
Adds an optional allowed_hosts config field to ArcGISPluginConfig. Any hostnames listed there are trusted in addition to *.arcgis.com and the portal domain. The configure wizard prompts for this value when setting up an ArcGIS plugin, so config.yaml is written correctly without manual editing.
Files changed
plugins/arcgis/config_schema.py — adds allowed_hosts: List[str] field
plugins/arcgis/plugin.py — passes allowed_hosts to _validate_feature_url; updates method to check the list
cli/commands/configure.py — adds a prompt for extra trusted hosts in the ArcGIS wizard step
To configure for DC:
When running
opencontext configure, entermaps2.dcgis.dc.govat the new prompt. Assuming this is unique for all cities, or if not may want to automatically add this instead?Screenshot Before

Screenshot After