-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render widgets on all clients in collaborative mode #11494
Conversation
Thanks for making a pull request to jupyterlab! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @trungleduc! LGTM!
Benchmark reportThe execution time (in milliseconds) are grouped by test file, test type and browser. The mean relative comparison is computed with 95% confidence. Results table
Changes are computed with expected as reference. |
@jtpio Can you take a look and merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the per output prompt far too invasive. As a user I would expect that if I trust or untrust a document, but I do see the point of trusting only some outputs.
So I would suggest getting a status only for the all notebook. This brings me to the fact that we already have a trust status on the notebook. So should we not revisit it to deal with real-time collaboration.
I will bring this up at the next meeting.
Hi @fcollonval, I initially started with only one prompt for trusting the notebook but then I realized in the context of RTC, we can trust the contents of the notebook at a moment but can not be sure about the contents coming after from other users. Btw I'm happy to update the PR after the conclusion of the next meeting. |
We can point folks to try it out with the Binder link on this PR since it has RTC enabled. |
People have nice idea in the yesterday meeting for the UI:
The idea would be to display the "plain/text" version of the output with a button (?) that allow to load the more complex view if the user trust the output. It would be good to have a way to set it up for the full notebook though - maybe extending the trust shield status bar indicator. |
And read the trust feature description in notebook documentation. I'm convinced that the RTC should not be considered as a special case and should follow that feature behavior. |
I politely disagree. We should treat it as a special case because in a sessions run by teachers/instructors for students we should not expose everyone in the class to a potential jokingly intended attack from one of the participants. Maybe this is something for which there should be roles, like only certain users have the rights to render widgets as trusted by default, and all others result in the plaintext + "I trust this output" shield button (the rationale is that the output presented interactively by the instructor/host should be trusted but the output from other participants should not; once the host trusts that output it would be trusted for everyone). Is this technically feasible to identify the host of the meeting right now, or is this something which will be only possible once the user package is in? Also, the preview could be an isolated iframe instead of the plaintext. |
I agree with @krassowski on this point, but since we haven't got the RBAC yet I think it will be difficult to identify the host of a session. @hbcarlos may have more insight about it? I like the idea about the per-output trust button but we should have also some way to trust every output. I'm thinking about this scenario:
|
True I forget the sync is two ways... For me the problem of the host is not related to the trust but as mentioned @trungleduc to sharing rights (that could already be implemented as they don't need to know about the user - they should be part of the shared session when created). If I compare with VS Code Live Share feature (in which you can share a terminal), from the host point of view you specify the right for the sharing resources (read-only, read and write). In the case of the notebook we certainly need more rights levels (adding the execution right for instance). And we should avoid having too complex states. But it definitely seems we should reboot the RTC meeting to discuss that kind of scenarii and how to address them (for instance at first being able to support a case like once the host trusts that output it would be trusted for everyone sounds to me going against what is proposed here as this is the owner of the client that says if he trusts the output or not). |
I'm not 100% sure, but I don't think we can identify the host, not even with the user package in. The only way would be to have RBAC and only users with ¿ |
a15cdfa
to
5ca73e5
Compare
88c1987
to
1647f69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some questions but mostly the code looks good.
@fcollonval Thanks for the review! Suggestions were applied in the last commit. |
Switched to draft since I'm having some issues with |
With the changes in widget.mp4 |
@fcollonval can you re-run the failed tests? I can not reproduce the failed tests on my PC. |
This looks good to me ! |
Should this approach be generalized to all outputs (not only widgets), and become the new trust mechanism? |
Definitely no for me, this is a completely different trust mechanism with completely different goals than the current one. This "new" trust mechanism does not consider sharing in different ways than with RT collaborations, and running headless. The current trust mechanism, is made for exchange of notebooks that will potentially be ran for example via nbconvert, or on a batch script. A local trust to each cell/output does not work. For example looking at local trust:
An d assume I trust this notebook, and each cell is "trusted" independently.
And now my $HOME is gone if I run "ipython my_notebook.ipynb". This is just an example, and when we designed the trust mechanism circa 2014, we found others examples where a set of multiple trusted and harmless items independently can become harmful together. This is why the trust is global, and attached to the serialised version of the notebook via signature. |
I don't fully yet get sense on that "new trust mecanism" looking at this PR. However, I am sure that any such change in the jupyter security paragdim should be further more discussed, brainstormed and approved from many jupyter subproject, and for sure by the jupyter security team. My first feedback is that if any new approach lowers down the security/trust guards, it should be a no-go. |
From @krassowski's comment: Which is in contradiction with your example @Carreau. |
For 1) Really it is there to protect against crafted notebook and unintended execution. In current notebook this happend to be JS/SVG. And it also happens that JS/SVG is sometime hidden. The current notebook decides to treat a valid and properly signed notebook to a notebook were each cell is marked as "trusted", and load it. But by default the notebook don't run Python code when loaded – therefore there is no need to use trust for this. But this is also reflected by the fact that a notebook is trusted if and only if all python cells, even if they have no output have been executed by current user. Though you can't design the jupyter trust mechanism to take into account only one frontend that happen to use Yjs and RTC, you should consider all other frontend (vs code, nbviewer, nbconvert, whatever), that may in the end take other decisions. And it is not necessary that there is a single "trust" mechanism. From what I can tell, there are two cases: A) load from storage (you want to make sure this is globally trusted/not tampered with). B) trust across peers in with YJS. I see both as complementary. And really A) is closer to any other application trusting/signing that you see on windows/mac/linux. Either you "ask the user" (which to click on "trust"), or you want some form of certificate/singing, which currently we only do locally with current user key. |
fa4940f
to
c816c68
Compare
c816c68
to
50bfbac
Compare
A few questions and thoughts:
|
@ellisonbg I'm completely in line with the direction of #12756. Closing this PR in favor of the other solution. |
References
Fixes #11435
Code changes
displayModelRequested
inCodeCellModel
, this signal is emitted when adisplay_data
message is processed.display_data
message from other clients is processed.User-facing changes
widget.mp4
shield-button.mp4
Backwards-incompatible changes
N/A