Repository navigation
feat!: safe mode by default, trusted replaces untrusted (#323) - #324
Merged
Merged
Conversation
Every package plays untrusted unless the page sets trusted. The verifier plays untrusted unless --trusted (--untrusted still taken); VS Code reads h5pPreview.trusted; the demo app and cmi5 page play every package untrusted and ask when one needs its own code; the MCP server and app play untrusted from their own pack copy. Embed and the SCORM page set trusted where they trust today. Docs, skills and the demo lead with safe by default.
alekswebnet
force-pushed
the
feat/trusted-by-default
branch
from
December 3, 2026 06:36
dc5e10a to
8223fd3
Compare
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Dec 3, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #323: safe mode by default, the element side. Embed's trust list and the untrusted SCORM zip, decided in #323, come in a second pull request on top of this one.
What changes (player 2.0)
trusted: its own library folders ignored, libraries fromlibraries(defaultpack),content/limited to H5P's file types, the content checked against the libraries' semantics. Whatuntrusteddid.trusted(attribute and property) plays a package as it is, with its own code. Theuntrustedattribute and property are gone; setting the attribute asks for the default.libraries, which it already has.Everything that sets trust now
--trustedand the optiontrustedplay the package's own code.--untrustedis still taken, so installed skills and older scripts run. The report keeps itsuntrustedfield.h5pPreview.trusted, off by default, replacesh5pPreview.untrusted; the preview's Untrusted switch starts on; Restricted Mode stays untrusted.demo/element.js).partsFolder, now exported by h5p-author). The MCP app's play page plays the activity it built untrusted, from the pack copy it builds with.trustedwhere it trusts today (its own origin, listed hosts, a third-party frame), and the SCORM launch page setstrustedon the author's package. The second pull request changes both.trustedas the exception.Breaking, for the release notes
pack-baseorpack), and a package that needs a library the pack lacks is refused withcarrieduntil the page setstrusted.revisionchanges, since it names the pack parts the package now plays against. Statements carry the new one. Withresume="device"a learner's saved state starts over once: one saved against another revision is dropped, and the runtime says the content has changed. Aresume="host"page that keys its saved state byrevisionsees the same.player.untrusted = falseno longer trusts a package.--trusted.h5pPreview.untrustedis no longer read;h5pPreview.trustedplays with the package's own code.@missing-elements/h5p-libraries1.1.2, whichmainnames and every untrusted load now fetches.Tests
trustedthrough the helper, since their content type is in no pack; untrusted plays say so), embed 83, verify 33, VS Code 30 and its suite in a real VS Code (8), demo 24 with two new cases (a same-site link plays untrusted; a file that needs its own code asks, naming it), author 335, MCP 24, MCP app 33, cmi5 50, journeys 56, skills 84. Typecheck and comments pass.Release: player, verify and the VS Code extension major or breaking; the packages that pin the player follow at the bump.
Summary by cubic
Safe mode is now the default: every package plays untrusted — none of its own code runs, its libraries come only from the
librariessources (the pack by default), and its content is checked against the libraries' semantics — unless the page setstrusted. Theuntrustedattribute and property are gone; setting one asks for the default.Breaking changes
carrieduntil the page setstrusted.player.untrusted = falseno longer trusts a package.h5p-verifyplays untrusted unless--trusted;--untrustedis still accepted and does nothing.h5pPreview.trustedinstead ofh5pPreview.untrusted.@missing-elements/h5p-libraries1.1.2, whichmainnames and every untrusted load now fetches.What it touches
trustedwhere they already trusted, so their behaviour is unchanged.trustedas the exception.Written for commit 8223fd3. Summary will update on new commits.