Skip to content

fix(client): Authorization-Remote header casing - #9

Open
gustavorps wants to merge 2 commits into
ParapluOU:mainfrom
gustavorps:pr/casing-fix
Open

fix(client): Authorization-Remote header casing#9
gustavorps wants to merge 2 commits into
ParapluOU:mainfrom
gustavorps:pr/casing-fix

Conversation

@gustavorps

Copy link
Copy Markdown

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. Authenticated clone/push/pull between servers (with remote_auth provided) 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:

  • Extract header construction into authorization_remote_header() (all four call sites: fetch, push, pull, clone)
  • No behavior change beyond the casing

Tests

Three unit tests pin the contract without needing a server:

  • header name is exactly Authorization-Remote
  • value is Basic <base64(user:pass)> (e.g. Basic YWRtaW46cm9vdA==)
  • encode_basic_auth format

Verification

  • cargo test -p terminusdb-client --lib — 3 new tests green
  • clone → push → pull roundtrip with remote_auth verified against a real TerminusDB 12.1 server (passes with this casing; failed with the old ALL-CAPS form)

Notes

  • The remaining v12 collaboration fixes (push/pull endpoint contract, registered-remote flow) will follow in a separate PR.
  • Clippy: no new warnings from this change (upstream main has pre-existing warnings, untouched).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant