feat(session)!: remove the deprecated SessionMiddleware - #402
Merged
Merged
Conversation
SessionMiddleware has been deprecated in favour of FastAPICacheXSessionMiddleware since 0.3.1 and was kept until 0.4.0 because a patch release could not drop an exported class. Remove it, its package exports, its API docs entry and the private _extract_header_token helper only it used, together with the tests that exercised it. Tests that installed it only to reach the session dependencies now use FastAPICacheXSessionMiddleware, and the docs describe it as removed. BREAKING CHANGE: SessionMiddleware is removed; use FastAPICacheXSessionMiddleware.
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.
Fixes #69.
SessionMiddleware, the header-only middleware, has been deprecated since 0.3.1 in favour ofFastAPICacheXSessionMiddleware.Code
_extract_header_tokenthat only it used.fastapi_cachexandfastapi_cachex.session, the API reference entry, and the mentions in comments and docstrings.Tests
test_get_session_manager.pyandtest_dependencies.pynow useFastAPICacheXSessionMiddleware, and the_read_header_tokentests are kept.user_agent_binding:FastAPICacheXSessionMiddlewarenever had one. It is ported in 10748b5, and it fails when the middleware stops passing the request's User-Agent.Docs
SESSION.mdandHTTP_CACHING.md(EN and zh-TW) now say the class was removed in 0.4.0.Migration:
app.add_middleware(FastAPICacheXSessionMiddleware, session_manager=..., config=...).Checks
UserSessionDeprequire a session with a user #127 branch.Changelog:
changelog.d/69.removed.md.