Merge conflict
Gerrit cannot merge this change. It needs a rebase onto main.
98329[BUGFIX] Use preview tokens in the frames of the workspace preview
Commit message
The workspace preview shows the live version and the workspace version of a page in two frames. Both frames use the backend login cookie. On a site whose host the cookie does not reach, the frames show the page as to a visitor. The workspace frame then shows the live version or "Page not found" instead of the workspace version. While the feature toggle "backend.previewToken" is enabled, the PreviewController of EXT:workspaces now loads both frames with a token: - The workspace frame gets a preview token for the current workspace of the backend user. ADMCMD_simTime and ADMCMD_simUser stay in its address. - The live frame gets a live view token. This token shows the page as a visitor sees it, also to a backend user who has no access to the live workspace. Thus the address of the live frame has no ADMCMD_simUser. - An address on no host of the preview opens without a token. - When a rule denies a token, the workspace preview shows a page with the status 403 and a message instead of the frames. The text comes from PreviewDenialLabelResolver, as in the module "Content > Preview". No cache keeps this page. - Both frames load without a Referer header, as the frame of the module "Content > Preview". The address of the workspace preview contains the token of the backend route. The backend user can switch the workspace in another tab while the frames are open. The workspace frame then keeps the workspace of its token: - WorkspaceOfTokenRule denies the renewal only when the backend user has no access to the workspace of the token. The reason is WorkspaceNotAccessible. The reason OtherWorkspace is removed. - The web mounts of a workspace can limit the web mounts of the backend user. Thus PreviewTokenIssuer resolves the hosts of such a renewal with a ReadOnlyBackendUserAuthentication in the workspace of the token, as the site does. This user also refuses a workspace that the groups of the backend user do not grant. The backend user of the request does not change. - PageRule still checks the web mounts of the current workspace. Its docblock tells that the site checks the page again in the workspace of the token. The tests of the workspace frame also cover scheduled and access-restricted versions of a page. The site shows them, because "Accept preview tokens in the frontend" reads the version of the page without these restrictions. The changelog entry of #110664 describes the workspace preview and the changed template Preview/Index.fluid.html for integrators who override it. The rule for more than 50 origins in frame-src is described once, in the section of the module. "Open the backend preview page for sites without backend cookie" adds the same label "error.denied.title" to the backend file preview.xlf. The second of the two changes to merge removes its copy. This change needs "[TASK] Add a live view kind of preview token" and builds on it. It is chained on top of that patch, the last patch of the chain below it. PreviewDenialLabelResolver comes from "Preview hidden pages across site domains", which is lower in the chain. Merge the patches below it in the chain first, then this change.
Show more Show less
Resolves: #TBD Related: #110664 Releases: main, 14.3 Change-Id: Idf96ebaab255da81ac3eef9ba498caccb740e747
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 1
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/29/98329/1 && git checkout FETCH_HEAD
- Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/29/98329/1 && git cherry-pick FETCH_HEAD
Review
-
Code review CR 0 Needs a vote
-
Verified V 0 Needs a vote
- core-ci +1 CI
Relation chain 16
-
98329 [BUGFIX] Use preview tokens in the frames of the workspace preview This change
- 98328[TASK] Add a live view kind of preview token
- 98327[BUGFIX] Follow the page of the preview frame in the backend
- 98326[BUGFIX] Keep the preview token in navigations that scripts start
- 98325[BUGFIX] Keep the preview token in links, forms and redirects
- 98324[BUGFIX] Renew the preview token of the frame
- 98323[TASK] Add one frame component for the preview frames of the backend
- 97235[BUGFIX] Preview hidden pages across site domains
- 98322[TASK] Accept preview tokens in the frontend
- 98321[TASK] Issue preview tokens in the backend
- 98320[TASK] Check where a request with a preview token comes from
- 98319[BUGFIX] Handle query parameters of links in one place
- 98318[TASK] Resolve the sites and hosts a backend user may preview
- 98317[TASK] Sign and verify preview tokens
- 98316[TASK] Add typed claims for preview tokens
-
98315[TASK] Add a read-only backend user for one workspace
The chain has patch set 1 of 2, the changes above it need a rebase.
Issues 1
Files 10
- typo3/sysext/backend/Classes/Preview/Rule/PageRule.php+5 −0
- typo3/sysext/backend/Classes/Preview/Rule/WorkspaceOfTokenRule.php+8 −8
- typo3/sysext/backend/Classes/Preview/PreviewTokenIssuer.php+34 −6
- typo3/sysext/backend/Resources/Private/Language/preview.xlf+5 −0
- typo3/sysext/backend/Tests/Functional/Preview/PreviewTokenIssuerTest.php+94 −11
- typo3/sysext/core/Classes/Preview/PreviewDenialReason.php+2 −7
- typo3/sysext/core/Documentation/Changelog/14.3.x/Important-110664-PreviewModuleShowsHiddenPagesOnEveryDomain.rst+56 −7
- typo3/sysext/workspaces/Classes/Controller/PreviewController.php+77 −5
- typo3/sysext/workspaces/Resources/Private/Templates/Preview/Index.fluid.html+2 −2
- typo3/sysext/workspaces/Tests/Functional/Controller/PreviewControllerTest.php+297 −9
Review log 23
-
Matthias Vogel uploaded patch set 1 12/04/26, 09:02
-
core-ci voted on patch set 1 V +1 12/04/26, 10:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/116315
-
Matthias Vogel wrote 12/04/26, 10:25
Topic set to cross-domain-preview