Merge conflict

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

Review main Work in progress

98327[BUGFIX] Follow the page of the preview frame in the backend

Matthias Vogel CR 0 V -1 Expert +1225 −114 updated 12/04/26, 10:25

Commit message

The preview frame of the backend knows only the address that the
backend gave it first. The token of this address expires after 15
minutes, and the frame gets a fresh token only after the site denied
the expired token. A script of the page in the frame cannot load
another host of the preview, because only the backend can issue a
token for it.

The navigation script of the page now tells the backend page the
address and the page that the frame shows. The backend page around
the frame follows this page:

- It renews the token one minute before the token expires. It also
  renews the token when the browser tab is visible again, because
  browsers delay the timers of a hidden tab. The page puts the fresh
  token into its address, its links, its forms and its data
  attributes. The page does not load again.
- It hands its current token to each page that reports its address,
  because a renewal can reach the page before it.
- A navigation to another host of the preview loads in the frame
  with a fresh token. Any other address of the web opens in a new
  tab without the token. An address on plain HTTP of a host whose
  sites use HTTPS only also opens in a new tab, because the browser
  sends the token in the clear on plain HTTP.
- It ignores the messages of a page on plain HTTP of such a host.
- It gets one token at a time, because each renewal posts the token
  of the renewal before.
- A reload loads the page that the frame showed last, with a fresh
  token, instead of the first address.
- A denial at an address gets a fresh token again after the frame
  showed the page at this address.

The settings of the frame name the hosts whose sites use HTTPS only
and the seconds until the token expires. For this reason,
PreviewHosts::getHttpsOnlyHosts() becomes public. The navigation
script gets the origin of the backend and the page in data
attributes. The error page of a site names no page, so the backend
page keeps the page that it showed before. The changelog entry of
the preview now describes the renewal before the token expires and
the navigations to other origins.

The preview with a token has no admin panel. Thus the backend page
relays no settings of an admin panel.

This change needs "[BUGFIX] Keep the preview token in navigations
that scripts start" and "[BUGFIX] Renew the preview token of the
frame". It is chained on top of "[BUGFIX] Keep the preview token in
navigations that scripts start". 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: I03383004bb4ef0c37589249e08640ce2a0d97f78

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/27/98327/1 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/27/98327/1 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V -1 Blocked
    • core-ci -1 CI

Relation chain 16

  1. 98329[BUGFIX] Use preview tokens in the frames of the workspace preview Based on this change Matthias Vogel → main, 14.3 Hard +580 −55 CR 0 V 0 Work in progress Merge conflict
  2. 98328[TASK] Add a live view kind of preview token Based on this change 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

  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 18

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:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/116311

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

    Topic set to cross-domain-preview