fix(client): Authorization-Remote header casing - #9
Open
gustavorps wants to merge 2 commits into
Open
Conversation
The v12 server looks up this header case-sensitively; AUTHORIZATION_REMOTE was silently ignored, breaking authenticated clone/push/pull between servers (verified against a real v12.1 server).
Extract authorization_remote_header() so the exact header casing is unit-testable without a server, and pin it with three tests (casing, Basic encoding, value format). The v12 server looks the header up case-sensitively — AUTHORIZATION_REMOTE was silently ignored.
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 client sends remote credentials as
AUTHORIZATION_REMOTE, but the TerminusDB v12 server looks this header up case-sensitively and silently ignores the ALL-CAPS form. Authenticatedclone/push/pullbetween servers (withremote_authprovided) fails with an auth error while appearing to be a connection problem.Fix
Send the header with the exact casing the server expects —
Authorization-Remote, matching the JavaScript client:authorization_remote_header()(all four call sites: fetch, push, pull, clone)Tests
Three unit tests pin the contract without needing a server:
Authorization-RemoteBasic <base64(user:pass)>(e.g.Basic YWRtaW46cm9vdA==)encode_basic_authformatVerification
cargo test -p terminusdb-client --lib— 3 new tests greenremote_authverified against a real TerminusDB 12.1 server (passes with this casing; failed with the old ALL-CAPS form)Notes
mainhas pre-existing warnings, untouched).