|
4 | 4 |
|
5 | 5 | A JupyterLab extension to manage secrets. |
6 | 6 |
|
| 7 | +> [!WARNING] |
| 8 | +> This extension is still very much experimental. Features and APIs are subject to change quickly. |
| 9 | +
|
| 10 | +## Overview |
| 11 | + |
| 12 | +The two main plugins of this extension are the `SecretsManager` and the `SecretsConnector`. |
| 13 | + |
| 14 | +### Secrets manager |
| 15 | + |
| 16 | +The manager be the only interface for extensions / users to retrieve secrets. |
| 17 | + |
| 18 | +It knows only one connector, its role is to act as an interface between an extension / user / input |
| 19 | +and the secrets connector. |
| 20 | + |
| 21 | +Extension should not query directly the secrets connector. All requests for secrets must go through the manager. |
| 22 | + |
| 23 | +### Secrets connector |
| 24 | + |
| 25 | +The secrets connector is the one that fetches and saves secrets. It partially implements the `Jupyterlab` |
| 26 | +[IDataConnector](https://github.com/jupyterlab/jupyterlab/blob/a911ae622d507313e26da77f1adc042c0b60b962/packages/statedb/src/dataconnector.ts#L28). |
| 27 | +Given a secrets ID, the connector should return the associated secrets. |
| 28 | + |
| 29 | +By default, the extension provides an 'in memory' secrets connector: secrets are stored only during the current session. |
| 30 | + |
| 31 | +The secrets connector is provided by a plugin (with a token). This means that a third party extension can disable the |
| 32 | +default one and provide a new connector (to fetch secrets from a remote server for example). |
| 33 | + |
| 34 | +## Features |
| 35 | + |
| 36 | +### Associating inputs and secrets |
| 37 | + |
| 38 | +Any third party extension can associate an HTML input element to a secret, using the `attach()` method of the manager. |
| 39 | +It requires a `namespace` and `id` to link the input with a "unique" ID. |
| 40 | +This association should be done when the input is attached to the DOM. |
| 41 | + |
| 42 | +Associating an input to an `namespace`/`id` triggers a fetch on the secrets connector. If a secrets is fetched, the |
| 43 | +input is filled with the value of that secret. |
| 44 | + |
| 45 | +When the user updates manually the input, it triggers a save of the secret by the secrets connector. |
| 46 | + |
7 | 47 | ## Requirements |
8 | 48 |
|
9 | 49 | - JupyterLab >= 4.0.0 |
|
0 commit comments