Report non-JSON token-endpoint responses as BfabricOAuthError - #601
Open
Caushi wants to merge 1 commit into
Open
Report non-JSON token-endpoint responses as BfabricOAuthError#601Caushi wants to merge 1 commit into
Caushi wants to merge 1 commit into
Conversation
…rror Device-code polling parsed the token endpoint's error body as JSON to tell authorization_pending from a real failure. When the body was not JSON at all -- an app-server 404 page while the REST module was redeploying -- the handler called raise_for_status(), throwing httpx.HTTPStatusError. That is neither a ValueError nor a RuntimeError, so it escaped @use_client's handler and the user got a traceback instead of an error message. Raise the domain error directly, so the CLI reports it like any other OAuth failure. Found while validating the OAuth flows against bfabric-test: the device code was authorized just as the instance redeployed. Also correct two stale entries in the OAuth design doc: from_url_token() and parse_url_token() do not exist -- the real API is connect_token() / from_token_data() and verify_jwt() -- and add the missing connect_pat() row.
Caushi
force-pushed
the
fix/device-code-non-json-error
branch
from
August 14, 2026 08:54
efce4ef to
f7c1a5c
Compare
Member
|
Thank you. I see no problem merging this, but I have two more general questions:
|
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.
Fix device-code login to report a non-JSON token-endpoint response (e.g. an app-server 404 page while the REST module redeploys) as
BfabricOAuthError, so the CLI prints an error message instead of anhttpx.HTTPStatusErrortraceback.Correct two stale entries in the OAuth design doc:
from_url_token()andparse_url_token()do not exist — the real API isconnect_token()/from_token_data()andverify_jwt().Add the missing
connect_pat()row to the design doc's factory-method table.