Repository navigation
fix(sdk): the back-channel logout log says why the form was rejected - #699
Draft
PiquelChips wants to merge 2 commits into
Draft
PiquelChips wants to merge 2 commits into
PiquelChips wants to merge 2 commits into
Conversation
The route passed form.ok() on, so every rejection, such as a wrong content type, was logged as a missing logout_token field. It now logs the FormRejection's chain.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Review follow-up: axum's rejection text already ends with its cause, which is also its source, so ErrorChain repeated it.
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 #544 (NEW-17, the Rust SDK's back-channel logout).
The Rust SDK's
POST /backchannel-logoutroute (theaxumfeature) passedform.ok()on, which dropped theFormRejection. So every rejected form was logged asback-channel logout without a logout_token form field, even one that had the field but the wrongContent-Typeor an unreadable body. The route now passes theResulton and logs the rejection. It logs with Display (error = %rejection), asapps/auth-service/src/web/account.rsdoes: axum's rejection text already ends with its inner error, which is also itssource(), soErrorChainwould print the cause twice.Changed log
back-channel logout without a logout_token form field(no fields)back-channel logout form rejected, witherror = %rejection, e.g.Form requests must have `Content-Type: application/x-www-form-urlencoded`orFailed to deserialize form body: missing field `logout_token`Unchanged
400 {"error":"invalid_request"}withCache-Control: no-store, and still404first when no logout handler is mounted.receive_logoutis private.cargo semver-checks -p sourceorigin-auth --baseline-rev origin/mainsays no semver update is required.Checks
cargo clippy --locked -p sourceorigin-auth --all-targets -- -D warnings, with and without--all-featuresRUSTDOCFLAGS='-D warnings' cargo doc --locked --no-deps --all-features -p sourceorigin-auth, andcargo test --doc --all-features: 48 passedcargo nextest run -p sourceorigin-auth --all-features: 48 passed.compile_fail::type_mistakes_do_not_compilewas run apart withcargo test --test compile_failand passes (30 s). Under nextest it once timed out at 300 s, building its trybuild crate from cold onCARGO_BUILD_JOBS=3.cargo semver-checks: 202 checks passNote
Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)