venkateshwaracholan opened a new pull request, #4783:
URL: https://github.com/apache/polaris/pull/4783
Fixes #4782
## Summary
Improve OAuth token error handling in the Python CLI.
Currently, `_get_token()` parses the OAuth response body twice and raises a
generic error when token retrieval fails. This change parses the response once
and surfaces OAuth `error` and `error_description` fields when available,
making authentication failures easier to diagnose.
## Changes
* Parse OAuth token responses using a single `json.loads()` call.
* Return `access_token` unchanged when present.
* Include OAuth `error` and `error_description` in `CliError` messages when
token retrieval fails.
* Preserve existing fallback behavior when no OAuth error fields are present.
* Add unit tests covering:
* successful token retrieval
* OAuth error with description
* OAuth error without description
* missing token and OAuth error fields
* invalid JSON responses
* single JSON parse behavior
## Checklist
- [ ] ๐ก๏ธ Don't disclose security issues! (contact [email protected])
- [ ] ๐ Clearly explained why the changes are needed, or linked related
issues: Fixes #
- [ ] ๐งช Added/updated tests with good coverage, or manually tested (and
explained how)
- [ ] ๐ก Added comments for complex logic
- [ ] ๐งพ Updated `CHANGELOG.md` (if needed)
- [ ] ๐ Updated documentation in `site/content/in-dev/unreleased` (if needed)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]