Structure missing-token authentication errors - #5
Draft
jshaw wants to merge 1 commit into
Draft
Conversation
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.
What changed
DataNetErrorwhen an HTTP-200 authentication response does not contain a non-empty JWTauthentication_failedcode and HTTP status for callersdatanet-sdkanddatanet.__version__from0.1.1to0.1.2Why
The Python SDK already rejected missing-token responses, but it used a generic
RuntimeError. The equivalent JavaScript fix now returns a structured authentication error, so Python should expose the same predictable error contract for applications, examples, and diagnostics.Developer impact
Code catching
DataNetErrorcan now handle this malformed authentication response usingerror.code == "authentication_failed"and inspecterror.status. Valid authentication behavior is unchanged.Validation
.venv/bin/python -m pytest— 27 tests passed.venv/bin/python -m ruff check ..venv/bin/python -m builddatanet_sdk-0.1.2.tar.gzdatanet_sdk-0.1.2-py3-none-any.whlgit diff --checkPublication
This PR prepares version
0.1.2but does not upload anything to PyPI or create a Git tag/release.