Repository navigation
fix(studio): export only a deck's own data, read as its instance allows - #735
Merged
Merged
Conversation
The Studio's deck export read a deck's cards and reviews documents with the signed-in user's credentials whenever they were in the user's own storage, even for a deck of an instance attached from someone else's pod, and then wrote every triple of those documents into the file. Such an instance's catalog may name a document of the user's own as a deck's, so the file could hold a whole document the user never thought of as part of the deck. Moving or copying cards and copying a deck into a draft already read such a document as no one; export did not. exportDeckFile now takes the instance and the WebID, and reads each of the deck's two documents as the user only when it is in the instance's pod (isInInstancePod), any other as no one, as transferCards does. The archive also exports only the deck's own subjects of those documents: its cards with the distractors they name, and the review states of those cards, with the blank nodes they lead to. An import already read nothing else, so a file still round-trips. Every caller of the archive now gives it the fetch that reads as no one and says which documents to read with it, so no document is read as the user by default. Refs: GHSA-xcjw-3f3x-g9fc
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.
What and why
The Studio's deck export read a deck's cards and reviews documents with the signed-in user's credentials whenever they were in the user's own storage. That held even for a deck of an instance attached from someone else's pod, and the export then wrote every triple of those documents into the file. Such an instance's catalog may name one of the user's own documents as a deck's, so the file could hold a whole document the user never thought of as part of the deck. Moving or copying cards and copying a deck into a draft already read such a document as no one; export did not.
What changes:
exportDeckFilenow takes the instance and the WebID. It reads each of the deck's two documents as the user only when the document is in the instance's pod (isInInstancePod), and reads it as no one otherwise, astransferCardsdoes.The Import & export screen passes the instance and the WebID.
docs/data-model.mdanddocs/studio.mddescribe the export.If a deck's document is read as no one and its server refuses access, the export now fails with an error instead of saving a file.
Refs: GHSA-xcjw-3f3x-g9fc