Repository navigation
v0.37.0
·
28 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
What changes in 0.37.0
0.37.0 gives every app a person's language the same way: the account's language from the sign-in, one resolver for "else the browser's", and the app's language named to the issuer. It also closes a path spelling that reached a route past webauth's path rules, and removes one unused parameter. Three changes are Breaking; every host changes its wiring once.
Per app
- Every host:
- pass
ui_language=toinstall_sign_in_routes: a callable that answersresolve_language(...)for the request, orlambda request: Noneto send no language; - build one
AppLanguages(offered, default)and callresolve_language(languages, account_tag=account_language_of_session(...), accept_language=request.headers.get("accept-language"))where the page's language is decided; write only its answer into<html lang>.
- pass
- songmaker, presentator (own session store): add a nullable column of at least 35 characters to the session table, take
account_languageincreateand return it on the record. - hopin, skat (
single_process_stores): no store change. - songmaker:
backchannel_dependenciesis gone; songmaker already stopped passing it. - A host test that sends a path with a control character and expects a route's answer or a 404 now gets 400.
New
webauth.languages(#718, PR #723;docs/host-contract.md, LANGUAGE-01 to LANGUAGE-12).AppLanguages(offered, default)is validated once: each tag in shape,defaultone ofofferedas spelled, no two offered tags equal ignoring case.resolve_language(languages, *, account_tag, accept_language) -> stranswers the first match of the account's tag, then theAccept-Languageranges by descending weight, then the default.- Matching is RFC 4647 Lookup:
de-ATfinds an offeredde;denever finds an offeredde-CH. The answer is the app's own spelling. - A tag that is
None, not in shape or unmatched counts as absent. Weight 0 and*are skipped; a malformed header element is dropped alone. is_language_tagis the one owner of a tag's shape;LogoutPageTextuses it.
webauth.dependencies.account_language_of_session(connection, *, sessions, config) -> str | None(#720, PR #727; LANGUAGE-17 to LANGUAGE-20).- It answers the account's language of the session a request carries, or
Nonewithout a live session. - It only loads. It never renews a session, refuses a request or sets a cookie, so a public page may call it.
- It answers the account's language of the session a request carries, or
Breaking
- The session row carries the account's language (#720, PR #727; LANGUAGE-13 to LANGUAGE-16).
SessionRecordStore.createrequires the keywordaccount_language: str | None;SessionRecordrequires the propertyaccount_language;OidcIdentitygains the required fieldaccount_language.- The callback writes the ID token's
localeclaim when it is a non-empty, printable string of at most 35 characters (MAX_ACCOUNT_LANGUAGE_CHARS), elseNone. Alocaleclaim never refuses a sign-in, and webauth does not judge the tag. - Written at sign-in only. Renewal and refresh-token rotation leave it: a person who changes the account's language sees it after the next sign-in. Sessions from before this release read
None. - Migration: a host with its own session store adds the nullable column, takes the keyword and returns it. A host on
single_process_storeschanges nothing. No host builds anOidcIdentityitself.
- The start route names the app's language to the issuer (#726, PR #728; LANGUAGE-21 to LANGUAGE-27).
install_sign_in_routesrequiresui_language: Callable[[Request], str | None];OidcRelyingParty.begin_loginrequires the keywordui_locales: str | None.- A tag sends
ui_locales=<tag>(OpenID Connect Core, section 3.1.2.1);Nonesends none; a string not in shape raisesValueErrorand nothing goes to the issuer. - Migration: every host passes
ui_language. A host that callsbegin_loginitself passesui_locales=Noneor a tag.
install_sign_in_routesno longer acceptsbackchannel_dependencies(#717, PR #725).- The back-channel logout route is open to anyone who can reach it, and the signed token is its only control; reachability stays the deployment's duty.
- SIGNIN-45, SIGNIN-46 and SIGNIN-48 left the host contract and the later ids of that section moved up by up to three; PR #725 holds the map.
- Migration: a host that passes the argument removes it.
Security
- A path with a control character is refused (#722, PR #724; STACK-08 to STACK-13).
- The standard stack answers an HTTP request whose path carries U+0000 to U+001F or U+007F with 400
{"detail": "Malformed request path"}, ahead of every rule and route. - Before, a path ending in an encoded line feed matched a route while webauth's exact path rules did not know it. Start, callback and logout then spent the default rate budget instead of the sign-in budget and answered without
no-store; the back-channel path lost its exemptions and its body rule. It gave no way to end a session without a signed token. - A refused request spends no rate budget and opens no session lookup. WebSocket handshakes pass untouched.
- No migration.
- The standard stack answers an HTTP request whose path carries U+0000 to U+001F or U+007F with 400
Not visible to a host
Full Changelog: v0.36.0...v0.37.0