Skip to content

fix(bridge): classify GitHub OAuth errors with JSON whitespace - #10

Merged
xgreenx merged 3 commits into
feat/callback-artifact-retrievalfrom
feat/localhost-http
Sep 14, 2026
Merged

xgreenx merged 3 commits into
feat/callback-artifact-retrievalfrom
feat/localhost-http

Conversation

@Wondertan

@Wondertan Wondertan commented Sep 10, 2026

Copy link
Copy Markdown
Member

GitHub token errors containing JSON whitespace, such as {"error": "incorrect_client_credentials"}, were missed by the literal "error":" search and reported as an unusable response/MPC-TLS failure. Separately, searching the entire transcript for "bad_verification_code" could classify a response using text outside the error field.

Read the actual error field with the shared whitespace-aware JsonMember reader instead. Its value determines the existing failure category:

  • bad_verification_code: the authorization code was refused; the caller should start a fresh ceremony.
  • Any other named error, including incorrect_client_credentials and redirect_uri_mismatch: report a deployment configuration problem.
  • No readable error field and no bearer: retain the unusable-response failure.

Classification still returns the Bridge's own messages; GitHub's raw response is not forwarded. The shared reader comes from released libid-rs v0.4.0, with the TLSN/MPZ pins kept compatible with notary v0.3.0-rc.3.

This started as a localhost HTTP support PR. That support is now in the base branch, so the remaining change has shifted entirely to GitHub error handling and its dependency updates.

@Wondertan Wondertan changed the title Allow localhost HTTP notary origins for development Allow localhost HTTP notary origins and match notary RC3 Sep 10, 2026
@SupremaLex
SupremaLex force-pushed the feat/callback-artifact-retrieval branch from ebbf109 to 31f3b70 Compare September 11, 2026 11:34
SupremaLex added a commit that referenced this pull request Sep 11, 2026
Production:
- `ON_EVERY_RESPONSE`: the `no-store` and `nosniff` pair, declared once in
  `routes` and carried by the health, callback, configuration and token
  responses.
- `Published::log`: the one log line naming a document's URL, validator and
  policy, at retrieval and at replacement.

Tests:
- `tests/http.rs`: one request builder (`token_request`), one body builder
  (`token_body_with` / `token_body_without`), one permit-holding poster;
  `post_token` takes the origins as a list.
- `session.rs`: one assembly helper over a duplex socket, with the notary's
  behaviour as an enum; one bearer opening.
- `request.rs`: one layout helper. `upstream.rs`: one deployed-Distribution
  helper.

jscpd: 12 clones, 66 lines → 1 clone, 5 lines; the one left is
`redirect_uri` beside `notary_host` (#10's function, kept verbatim).

Assisted-by: Claude Fable 5.1
Signed-off-by: SupremaLex <georglutsenko@gmail.com>
Use released libid-rs v0.3.0 and the matching TLSN/MPZ pins, including the MPZ active-context lifetime fix.

Assisted-by: GPT-6
Signed-off-by: Wondertan <hlibwondertan@gmail.com>
Pin the shared Rust transcript reader and classify the actual error field using the same reader.

Assisted-by: GPT-6
Signed-off-by: Wondertan <hlibwondertan@gmail.com>
@Wondertan Wondertan changed the title Allow localhost HTTP notary origins and match notary RC3 build: match notary RC3 and whitespace-aware transcripts Sep 11, 2026
Replace the closed whitespace PR dependency with its released successor while retaining the matched RC3 TLSN and MPZ runtime patches.

Assisted-by: GPT-6
Signed-off-by: Wondertan <hlibwondertan@gmail.com>
@Wondertan Wondertan changed the title build: match notary RC3 and whitespace-aware transcripts fix(bridge): classify GitHub OAuth errors with JSON whitespace Sep 11, 2026
@Wondertan Wondertan self-assigned this Sep 11, 2026
@xgreenx
xgreenx merged commit daebcf3 into feat/callback-artifact-retrieval Sep 14, 2026
3 checks passed
SupremaLex added a commit that referenced this pull request Sep 14, 2026
Production:
- `ON_EVERY_RESPONSE`: the `no-store` and `nosniff` pair, declared once in
  `routes` and carried by the health, callback, configuration and token
  responses.
- `Published::log`: the one log line naming a document's URL, validator and
  policy, at retrieval and at replacement.

Tests:
- `tests/http.rs`: one request builder (`token_request`), one body builder
  (`token_body_with` / `token_body_without`), one permit-holding poster;
  `post_token` takes the origins as a list.
- `session.rs`: one assembly helper over a duplex socket, with the notary's
  behaviour as an enum; one bearer opening.
- `request.rs`: one layout helper. `upstream.rs`: one deployed-Distribution
  helper.

jscpd: 12 clones, 66 lines → 1 clone, 5 lines; the one left is
`redirect_uri` beside `notary_host` (#10's function, kept verbatim).

Assisted-by: Claude Fable 5.1
Signed-off-by: SupremaLex <georglutsenko@gmail.com>
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.

2 participants