Repository navigation
feat(server/app): console tabs a thin binary adds #557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
LeeroyHannigan
wants to merge
21
commits into
feat/thin-bin-extensions
Choose a base branch
from
feat/console-tabs
base: feat/thin-bin-extensions
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,234
−292
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
de03fe5
feat(server,app): console tabs a thin binary adds
LeeroyHannigan cffa41a
docs: describe console tabs
LeeroyHannigan 786940b
Merge feat/thin-bin-extensions into feat/console-tabs
LeeroyHannigan 750c38f
fix(console): run the catalog session check on console tabs
LeeroyHannigan df8eef0
Merge feat/thin-bin-extensions into feat/console-tabs
LeeroyHannigan 0f4556d
docs(console): say how the built-in admin pages refuse an IAM-user se…
LeeroyHannigan c27e1d8
refactor(console): take the tab label and admin flag from one identit…
LeeroyHannigan 4943055
test(console): run the tab session check for each session state
LeeroyHannigan 41a6c51
fix(console): build each page's navigation bar from its session
LeeroyHannigan 4068b65
fix(console): remove Debug from ConsoleIdentity
LeeroyHannigan 53ab8a3
fix(console): refuse a tab request that may change state without the …
LeeroyHannigan c7b7e20
fix(server): keep axum's default console fallback when no tab is mounted
LeeroyHannigan 1a75627
docs(server): say how a tab slug and a built-in page answer without a…
LeeroyHannigan 93275b3
fix(server): reserve the console router's first segments and refuse a…
LeeroyHannigan d7fe18e
test(console): check that a tab POST with the token in a JSON body ge…
LeeroyHannigan 9237e0f
test(console): check a PROPFIND without the token, and state which me…
LeeroyHannigan 62014f8
Merge feat/thin-bin-extensions into feat/console-tabs
LeeroyHannigan 9cabee9
test(server): pass the storage argument to build_state_with in the st…
LeeroyHannigan 592fbad
fix(console): name the four methods that reach a tab without the token
LeeroyHannigan ca128ba
Merge feat/thin-bin-extensions into feat/console-tabs
LeeroyHannigan 9f5749d
test(console): check that HEAD, OPTIONS and TRACE reach a tab without…
LeeroyHannigan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional. CSRF is checked by each tab's handler, and a POST with a valid cookie and no
_csrfreaches it. The cookie isSameSite=Strict, which stops cross-site requests and not same-site ones from another port on the host. The PR's Why section says the same CSRF protection applies, and the manual (12-extending-extenddb-storage.md:367) says the layout adds_csrfto every form, where a script adds it to POST forms.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the check into the tab mount. A check in each handler lets a tab that forgets it accept a same-site POST. In 53ab8a3,
require_console_sessionreads the body of each request whose method is not GET, HEAD, OPTIONS or TRACE. It answers 403 "CSRF token mismatch" unless the_csrfform field is the session's token. It reads the field with axum'sForm, as the built-in pages do, and calls theirrequire_csrf. The tab's router gets the whole body. A body over axum's 2 MB default gets 413 before the router. A body that is not anapplication/x-www-form-urlencodedform, such as JSON or multipart, gets 403.The table has rows for no token, another token, a
DELETEand the token in a JSON body (d7fe18e), each 403 before the page runs. 9237e0f adds aPROPFINDrow, which fails when the check guards only POST, PUT, PATCH and DELETE. 53ab8a3 also deletescsrf_matches. The Why section and the manual now describe the check and the script that adds_csrfto POST forms. The manual also says that GET, HEAD, OPTIONS and TRACE reach the tab without the token, so a tab changes state only on another method.