Merge conflict

Gerrit cannot merge this change. It needs a rebase onto main.

Review main Work in progress

98329[BUGFIX] Use preview tokens in the frames of the workspace preview

Matthias Vogel CR 0 V 0 Hard +580 −55 updated 12/04/26, 10:25

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

  1. 98329 [BUGFIX] Use preview tokens in the frames of the workspace preview This change

  2. 98328[TASK] Add a live view kind of preview token This change is based on it Matthias Vogel → main, 14.3 Hard +771 −73 CR 0 V 0 Work in progress Merge conflict
  3. 98327[BUGFIX] Follow the page of the preview frame in the backend This change is based on it Matthias Vogel → main, 14.3 Expert +1225 −114 CR 0 V -1 Work in progress Merge conflict
  4. 98326[BUGFIX] Keep the preview token in navigations that scripts start This change is based on it Matthias Vogel → main, 14.3 Hard +922 −4 CR 0 V 0 Work in progress Merge conflict
  5. 98325[BUGFIX] Keep the preview token in links, forms and redirects This change is based on it Matthias Vogel → main, 14.3 Hard +828 −38 CR 0 V 0 Work in progress Merge conflict
  6. 98324[BUGFIX] Renew the preview token of the frame This change is based on it Matthias Vogel → main, 14.3 Expert +1634 −63 CR 0 V 0 Work in progress Merge conflict
  7. 98323[TASK] Add one frame component for the preview frames of the backend This change is based on it Matthias Vogel → main, 14.3 Hard +544 −68 CR 0 V 0 Work in progress Merge conflict
  8. 97235[BUGFIX] Preview hidden pages across site domains This change is based on it Matthias Vogel → main, 14.3 Hard +467 −10 CR 0 V 0 Work in progress Merge conflict 19 unresolved
  9. 98322[TASK] Accept preview tokens in the frontend This change is based on it Matthias Vogel → main, 14.3 Expert +1994 −4 CR 0 V 0 Work in progress Merge conflict
  10. 98321[TASK] Issue preview tokens in the backend This change is based on it Matthias Vogel → main, 14.3 Hard +880 −1 CR 0 V 0 Work in progress Merge conflict
  11. 98320[TASK] Check where a request with a preview token comes from This change is based on it Matthias Vogel → main, 14.3 Hard +934 −1 CR 0 V 0 Work in progress Merge conflict
  12. 98319[BUGFIX] Handle query parameters of links in one place This change is based on it Matthias Vogel → main, 14.3 Hard +435 −20 CR 0 V 0 Work in progress
  13. 98318[TASK] Resolve the sites and hosts a backend user may preview This change is based on it Matthias Vogel → main, 14.3 Hard +700 −0 CR 0 V 0 Work in progress
  14. 98317[TASK] Sign and verify preview tokens This change is based on it Matthias Vogel → main, 14.3 Hard +625 −0 CR 0 V -1 Work in progress Merge conflict
  15. 98316[TASK] Add typed claims for preview tokens This change is based on it Matthias Vogel → main, 14.3 Hard +530 −0 CR 0 V -1 Work in progress
  16. 98315[TASK] Add a read-only backend user for one workspace This change is based on it Matthias Vogel → main, 14.3 Expert +1719 −2 CR 0 V 0 Work in progress

    The chain has patch set 1 of 2, the changes above it need a rebase.

Issues 1

Files 10

Review log 23

  1. Matthias Vogel uploaded patch set 1 12/04/26, 09:02

  2. 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

  3. Matthias Vogel wrote 12/04/26, 10:25

    Topic set to cross-domain-preview