Skip to content

Preserve authentication errors for catch-all 401 responses - #620

Merged
AndreyVMarkelov merged 1 commit into
mainfrom
andreymarkelov/fix-auth-error-decoding
Oct 22, 2026
Merged

AndreyVMarkelov merged 1 commit into
mainfrom
andreymarkelov/fix-auth-error-decoding

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Uploads that receive a 401 response with an explicit other authentication-error tag currently raise Stone's ValidationError, hiding the normal authentication exception and request ID. Decode these responses as AuthError.other, tolerate new authentication-error variants and fields, and preserve the original response body on AuthError.body for diagnosis. Existing two-argument AuthError construction remains compatible.

Refs #585. This fixes the SDK's error reporting; the cause of the original server rejection still needs investigation.

Validation:

  • pytest test/unit/ -q: 118 passed, including seven regression cases through the upload request path. These cover explicit catch-all tags, unknown variants, known errors, and missing-scope details, and verify that non-expired authentication failures are not retried.
  • Ruff lint and formatting checks passed for the repository sources, excluding the locally generated _version.py from formatting.
  • Live integration tests were not run locally because test-account credentials are unavailable. This same-repository PR is eligible for the existing integration CI jobs.

Checklist

General Contributing

  • Have you read the Code of Conduct and signed the CLA?

Is This a Code Change?

  • Non-code related change (markdown/git settings etc)
  • SDK Code Change
  • Example/Test Code Change

Validation

  • Does tox pass? (Full tox suite not run.)
  • Do the tests pass?

@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.36%. Comparing base (084bd9e) to head (691ed72).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #620      +/-   ##
==========================================
+ Coverage   65.33%   65.36%   +0.02%     
==========================================
  Files          36       36              
  Lines       69148    69152       +4     
  Branches     4986     4987       +1     
==========================================
+ Hits        45180    45198      +18     
+ Misses      23716    23700      -16     
- Partials      252      254       +2     
Flag Coverage Δ
integration 64.37% <75.00%> (+0.01%) ⬆️
unit 65.08% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AndreyVMarkelov
AndreyVMarkelov merged commit 51e6b81 into main Oct 22, 2026
35 checks passed
@AndreyVMarkelov
AndreyVMarkelov deleted the andreymarkelov/fix-auth-error-decoding branch October 22, 2026 15:48
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