feat: support configurable self-hosted API URLs - #25
Closed
dyk1454683243-sudo wants to merge 1 commit into
Closed
dyk1454683243-sudo wants to merge 1 commit into
dyk1454683243-sudo wants to merge 1 commit into
Conversation
Add a Self-hosted environment in extension options so a custom Curate host can be used without editing the manifest or rebuilding. URLs are validated and sanitized, and extra host access is requested at save time through optional_host_permissions. Fixes DevOlabode#14 Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
|
@cursoragent is attempting to deploy a commit to the solabode499-5056's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
Withdrawing this PR while I clean up a high-volume open-PR backlog. Sorry for the noise — happy to come back later with a focused change if useful. |
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.
What does this PR do?
Lets the extension talk to a self-hosted Curate API without editing
manifest.jsonor rebuilding.The options page now has three environments:
https://curate-h0ga.onrender.com)localhost,127.0.0.1,[::1])Default
host_permissionsstay limited to the hosted origin andhttp://localhost:3000. Extra hosts useoptional_host_permissionsandchrome.permissions.request()on Save / Test connection, so Chrome prompts for that origin only.connect-srcis scoped tohttps:plus loopback HTTP. That matches validation:http://is rejected except on loopback, so LAN HTTP is not silently broken by CSP.A custom URL previously stored under Production is promoted to Self-hosted instead of being overwritten.
Related Issue
Fixes #14
Type of Change
Testing
npm test)http://non-loopback rejected)npm run build:extension)buildcheck passedtests/unit/apiUrl.test.jscovers sanitization (scheme, wildcards, credentials, loopback HTTP), storage resolution / migration, and the manifest permission/CSP constraints.Design notes (from #14)
optional_host_permissions, not a wider defaulthost_permissions.*, credentials, query, and fragment, and keeps a path prefix.https:+ localhost variants). A background relay would not help: MV3 service workers use the sameextension_pagesCSP.Checklist