Repository navigation
Sign the /path proxy URL; fall back to it for unreachable vocabulary - #1841
Closed
michielbdejong wants to merge 1 commit into
Closed
michielbdejong wants to merge 1 commit into
michielbdejong wants to merge 1 commit into
Conversation
fetchResourceHTTP signed the request before swapping in the /path proxy URL, so the signature covered the external subject while the server verified it against the proxy URL it received, and refused it (401). Build the proxy URL first and sign exactly that. When a direct fetch of a foreign plain document fails (network, CORS, 5xx), the Store now retries once through the own server's /path proxy, which fetches and keeps external vocabulary. The answer takes the same applyIncoming path as a direct one, so it is cached the same way. An origin the proxy served goes to the proxy first for the rest of the session; if that fails, the origin itself is tried once. Queries, collections, POSTs and the own server are never proxied. 5xx responses other than 500 are now typed as server errors too. Closes #1838 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
joepio
added a commit
that referenced
this pull request
Sep 25, 2026
Member
|
Landed on develop in ef161c3 via the combined batch #1844 (green on Mancave, run 4645). Closing. Generated by Claude Code |
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.
Closes #1838
Stacked on #1840 (base
claude/unsigned-cross-origin-vocab).Root cause
Client.fetchResourceHTTPsigned the request first and swapped in{server}/path?path=<subject>afterwards. So the signature covered the external subject. The server checks it against the full URL it receives (get_client_agent(headers, …, &full_url)), so it answered 401. It only seemed to work forhttps://atomicdata.devsubjects, and only because those were never signed at all.Separately, a browser that couldn't reach a vocabulary host never asked its own server. A cold browser with Pages down showed a table with only
#.Fix
Signing (
browser/lib/src/client.ts)proxyPathUrl(). Exactly that URL is signed.ErrorType.Server.Fallback (
Store._fetchResourceFromServerImpl)/path. That server fetches the external class on first use and keeps it.applyIncomingpath as a direct one, so it is stored and cached the same way.?drive=still has to reach the collection code.)No server changes were needed. The server already accepts a correctly signed
/pathrequest.Tests
browser/lib/src/vocab-proxy-fallback.test.ts(vitest):createSignature(proxyURL, ts), not the subject's.browser/lib/tests/vocab-proxy.integration.test.tsruns a realatomic-serveragainst a local stub origin that behaves like Pages (GET withACAO: *, 405 on a preflight):Store.fetchResourceFromServerfalls back to the proxy when the stub returns 503 to the browser.Also run: the
browser/libsuite (1034 tests), the data-browser vitest suite, lint and typecheck.🤖 Generated with Claude Code