Skip to content

feat(session): warn about the token_source_priority and use_bearer_token changes in 0.3.9 - #378

Merged
allen0099 merged 1 commit into
masterfrom
feat/75-377-token-source-warnings
Sep 29, 2026
Merged

allen0099 merged 1 commit into
masterfrom
feat/75-377-token-source-warnings

Conversation

@allen0099

Copy link
Copy Markdown
Owner

Refs #75, #377. The removals themselves stay in 0.4.0; this adds the 0.3.9 notices, since 0.3.9 is the last 0.3.x.

Summary

Tests

  • tests/session/test_0_4_0_notices.py covers:
    • the warning, and the silence for the default list and for lists that include "cookie";
    • the last-entry rule;
    • that 0.3.9 still reads the cookie with or without the entry;
    • the use_bearer_token warning for True and False, and silence without it.
  • The two existing use_bearer_token=False tests now expect the deprecation warning. The "unknown source" tests use "query", since "cookie" is now a known entry.
  • Removing the middleware warning call fails 4 tests.
  • The full suite passes (coverage 94.59%), pre-commit passes, and both docs builds pass with --strict.

…ken changes in 0.3.9

0.4.0 makes token_source_priority name every token source, with the
default ["header", "bearer", "cookie"], and a list without "cookie"
disables the session cookie (#75). The list now accepts "cookie" as its
last entry, where the cookie is read today, and
FastAPICacheXSessionMiddleware emits a FutureWarning when the list was
set explicitly without it.

use_bearer_token duplicates the list and is removed in 0.4.0 (#377);
passing it now emits a DeprecationWarning.
@allen0099 allen0099 added this to the 0.3.9 milestone Sep 29, 2026
@allen0099 allen0099 added enhancement New feature or request session Session management subsystem labels Sep 29, 2026
@allen0099
allen0099 merged commit 5ca98bd into master Sep 29, 2026
12 checks passed
@allen0099
allen0099 deleted the feat/75-377-token-source-warnings branch September 29, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request session Session management subsystem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant