docs: publish every guide in English and bring them up to date - #85
Merged
Merged
Conversation
The site mixed English and Chinese: CACHE_FLOW, JWT_CLAIMS, STATE and much of SESSION were written in Chinese. Rewrite them in English and, while doing so, check each claim and example against the code. The Chinese README stays in the repository for GitHub readers but leaves the site navigation until a proper zh-TW translation project exists. Corrections found while checking the guides against the code: - JWT_CLAIMS: a custom serializer was plugged in through `manager._token_serializer`, an attribute the manager never reads; the examples now pass `token_serializer=`. `exp` follows the session's `expires_at` (sliding renewal), not always `iat + session_ttl`. `get_session()` returns `(session, renewed_token)` and a bad token raises SessionTokenError, not ValueError. Only HS* algorithms work with the built-in serializer. - SESSION: `jwt_leeway` defaults to 0, not 60. The quick start added the middleware twice and missed imports; flash messages need `update_session` to stay cleared; there is no httpOnly option because the cookie is always HttpOnly. - CACHE_FLOW: non-GET responses get no Cache-Control header; `clear_path()` skips parameterised entries unless `include_params`; Memcached `clear()` runs flush_all rather than doing nothing; `no_cache=True` still writes entries. - STATE: a state already evicted by the backend TTL raises InvalidStateError, not StateExpiredError; `get_state_manager()` has no MemoryBackend fallback. - README: `/cached-hits` lists cached entries, it does not count hits; the Memcached limitations are complete now. DEVELOPMENT: tox covers 3.10-3.14, plus a section on building the documentation site. Callouts use the GitHub `> [!NOTE]` syntax everywhere; the markdown-callouts extension renders them as admonitions on the site instead of showing a literal `[!NOTE]`. Refs #81
This was referenced Sep 25, 2026
This was referenced Sep 25, 2026
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.
Part of #81.
What
CACHE_FLOW.md,JWT_CLAIMS.md,SESSION.mdandSTATE.mdwere fully or partly Chinese. While rewriting them, every claim and example was checked against the code; the corrections are listed below.README.md,DEVELOPMENT.mdandCONTRIBUTING.md.DEVELOPMENT.mdgains a section on building the docs site and adding API pages.docs/README.zh-TW.mdleaves the site navigation. It stays in the repo, and the README language switcher still links to it on GitHub. A proper zh-TW translation can come later as a Read the Docs translation project.> [!NOTE]syntax. Themarkdown-calloutsextension (a new docs-group dependency) renders them as admonitions on the site instead of printing a literal[!NOTE].Corrections found against the code
JWT_CLAIMS
manager._token_serializer = ..., was silently ignored. The examples now passtoken_serializer=.expfollows the session'sexpires_at, so it tracks sliding renewal. It falls back toiat + session_ttlonly when noexpires_atis set.get_session()returns(session, renewed_token).SessionTokenError, notValueError.SESSION
jwt_leewaydefaults to0, not60.update_session.CACHE_FLOW
Cache-Controlheader.clear_path()skips entries with query params unlessinclude_params=True.clear()runsflush_all; it is not a no-op.no_cache=Truestill writes cache entries.SET ... EX, notSETEX.STATE
InvalidStateError, notStateExpiredError.get_state_manager()has noMemoryBackendfallback.README
/cached-hitslists the cached entries; it does not count hits.DEVELOPMENT
Possible code issues found (not fixed here)
jwt_algorithmaccepts RS/ES/PS/EdDSA, but the serializer signs with the stringsecret_key, so those algorithms fail at encode time.X-Forwarded-For, but the helper that reads it (_get_client_ip) is private.StateManager.create_statedocumentsStateDataErrorfor backend failures that actually propagate unchanged.Verification
zensical build --strict: no issues.[!NOTE]/[!WARNING].README.zh-TW.mdand the README language switcher.uv-lockhook was skipped because it upgrades unrelated packages).uv lock --checkpasses; the lockfile only gainsmarkdown-callouts.TestClient.