Skip to content

[FEATURE] FileDelivery: deliver single files on the ILIAS domain despite content isolation - #12218

Open
chfsx wants to merge 2 commits into
ILIAS-eLearning:trunkfrom
srsolutionsag:feature/12/scorm-no-uci
Open

chfsx wants to merge 2 commits into
ILIAS-eLearning:trunkfrom
srsolutionsag:feature/12/scorm-no-uci

Conversation

@chfsx

@chfsx chfsx commented Oct 16, 2026

Copy link
Copy Markdown
Member

What

With User Content Isolation active, IRSS content is delivered from the content domain only. SCORM packages cannot run there yet: a SCO looks up the SCORM API in its parent window and calls it synchronously, which the browser blocks as soon as SCO and player are on different origins.

This PR adds a way to deliver an IRSS container from the ILIAS domain even when the isolation is active: ContainerURIConsumer::withoutIsolation(). Internally it uses FileDeliveryServices::buildTokenURLWithoutIsolation(), SrcBuilder::getRevisionURLWithoutIsolation() and DataSigning::getSignedStreamTokenWithoutIsolation(), which are marked @internal.

The decision is part of the signed token. deliver.php serves such a token only on the ILIAS domain (404 on the content domain) and without the cross-origin headers; every other token is still served on the content domain only. Without active isolation nothing changes.

Deprecated from the start

We do not want content outside of the isolation. Content delivered this way runs with the session of the user on the ILIAS origin, exactly what the isolation is meant to prevent. All of them are therefore deprecated right away and will be removed with ILIAS 13.

To keep this visible, a new code rule ilias.deliveryWithoutIsolation (scripts/PHPStan/Rules/ContentIsolation/DeliveryWithoutIsolationRule.php) reports every call of withoutIsolation() in consumer code and fails the code-rules gate. A caller has to be allowed explicitly, and the allowance is only valid for ILIAS 12.

For Alex Hartwig: how SCORM registers its use

Once SCORM is delivered from the IRSS, the method that builds the package URL has to carry the allowance attribute:

use ILIAS\Scripts\PHPStan\Attributes\AllowDeliveryWithoutIsolation;

#[AllowDeliveryWithoutIsolation('SCORM must run without isolation in ILIAS 12 despite the IRSS; with ILIAS 13 SCORM implements a postMessage proxy', 12)]
public function getContainerBaseUri(): ?string
{
    return (string) $this->irss->consume()
                               ->containerURI($this->rid, 'index.html')
                               ->withoutIsolation()
                               ->getURI();
}
  • The attribute goes on the method (or class) that calls withoutIsolation(), with the reason (SCORM must run without isolation in ILIAS 12 despite the IRSS; with ILIAS 13 SCORM implements a postMessage proxy) and the ILIAS major 12.
  • Without it, ./scripts/PHPStan/run_code_rules.sh components/ILIAS/ScormAicc (and the code-rules CI job) reports the call.
  • scripts/PHPStan/list_exemptions.sh components/ILIAS/ScormAicc lists the allowance.
  • With ILIAS 13 the allowance expires and the call is reported again; by then SCORM has to run on the content domain with a postMessage proxy between the SCO and the player, and the methods will be gone.

Details: components/ILIAS/FileDelivery/README.md, section "Delivering on the ILIAS domain", and scripts/PHPStan/README.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant