jupyter / jupyter/nbformat

Unintuitive API for trust/signing a notebook

Open
#98 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
313
Forks
176
PR merge metrics
No merged PRs in 30d

Description

I was working on [this issue](https://github.com/jupyter/notebook/issues/195) in the notebook repo and was confused by the ``NotebookNotary`` class's API.

The ``check_cells`` method returns a boolean, but it also pops off the ``trusted`` key from cells' metadata. IMO, you can never tell, looking at the API, that it mutates the notebook contents model passed to it. Also, if you do not use check_cells and call ``sign`` or ``compute_signature`` or ``check_signature`` directly, the ``trusted`` key is not popped off.

Could we not mutate the notebook model [here](https://github.com/jupyter/nbformat/blob/master/nbformat/sign.py#L484) ? And, it should be conveyed to the user that ``sign`` and other like methods would require you to remove the ``trusted`` key.

If you agree something should be done here, I'd be willing to work on it.

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.