-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add Client Middleware Cookbook #10945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is still quite raw, but I am opening it so the team can adjust/add
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #10945 +/- ##
==========================================
- Coverage 98.77% 98.76% -0.01%
==========================================
Files 129 129
Lines 39539 39541 +2
Branches 2186 2185 -1
==========================================
Hits 39054 39054
- Misses 337 339 +2
Partials 148 148
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #10945 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new Client Middleware Cookbook with practical examples, integrates it into the main client docs, updates the spelling wordlist, and adds a CHANGES entry.
- Introduce a comprehensive
client_middleware_cookbook.rst
with multiple middleware patterns. - Link the new cookbook in
docs/client.rst
and add “backoff” to the spelling wordlist. - Add a CHANGES file placeholder entry for this feature.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
docs/spelling_wordlist.txt | Added “backoff” to the approved spelling list. |
docs/client_middleware_cookbook.rst | New cookbook covering Basic Auth, retry, logging, and token refresh middleware. |
docs/client.rst | Inserted navigation link to the Client Middleware Cookbook. |
CHANGES/10945.feature.rst | Created feature entry (filename and content need alignment). |
Comments suppressed due to low confidence (2)
docs/client_middleware_cookbook.rst:305
- ClientRequest does not have a
session
attribute;request.session
will likely be undefined. Consider passing theClientSession
instance into the middleware (e.g., store it on init) or otherwise provide access to the session for token refresh calls.
await self._refresh_access_token(request.session)
CHANGES/10945.feature.rst:1
- The change entry references
9732.feature.rst
but the filename is10945.feature.rst
. Update the internal reference to match the correct feature number.
9732.feature.rst
Backport to 3.12: 💚 backport PR created✅ Backport PR branch: Backported as #10969 🤖 @patchback |
(cherry picked from commit 1878509)
…10969) Co-authored-by: J. Nick Koston <[email protected]>
Adds client middleware cookbook and examples