listings.rst 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. .. _listings:
  2. Listings
  3. ---------
  4. When searching extensions, JupyterLab can check the extensions against ``blacklists``
  5. and ``whitelists``. Only one mode at a time is allowed.
  6. List modes
  7. ~~~~~~~~~~
  8. .. _blacklist_mode:
  9. Blacklist
  10. ^^^^^^^^^
  11. Extensions can be freely downloaded without going through a vetting process.
  12. However, users can add malicious extensions to a blacklist.
  13. The extension manager will show all extensions except for those that have
  14. been explicitly added to the blacklist. Therfore, the extension manager
  15. does not allow you to install blacklisted extensions.
  16. .. _whitelist_mode:
  17. Whitelist
  18. ^^^^^^^^^
  19. A whitelist maintains a set of approved extensions that users can freely
  20. search and download.
  21. Extensions need to go through some sort of vetting process before they are
  22. added to the whitelist. When using a whitelist, the extension manager
  23. will highlight extensions that have been explicitly added to the whitelist.
  24. List URI
  25. ~~~~~~~~
  26. By default, JupyterLab ships with blacklist mode enabled. The blacklist can
  27. be found on https://github.com/jupyterlab/listings/blacklist.json
  28. Please open a `pull request <https://github.com/jupyterlab/jupyterlab/pulls>`__
  29. if you think that some extensions should be blacklisted.
  30. Open also a `pull request <https://github.com/jupyterlab/jupyterlab/pulls>`__
  31. if your extensions is blacklistd and you think it should not.
  32. List format
  33. ~~~~~~~~~~~
  34. This is an example of a blacklist.
  35. .. code:: json
  36. {
  37. "blacklist": [
  38. {
  39. "name": "@jupyterlab-examples/launcher",
  40. "type": "jupyterlab",
  41. "reason": "@jupyterlab-examples/launcher is blacklisted for test purpose - Do NOT take this for granted!!!",
  42. "creation_date": "2020-03-11T03:28:56.782Z",
  43. "last_update_date": "2020-03-11T03:28:56.782Z"
  44. }
  45. ]
  46. }
  47. The ``name`` attribute support regular expressions.
  48. In the following example a ``@jupyterlab/*`` will whitelist
  49. all jupyterlab organization extensions.
  50. .. code:: json
  51. {
  52. "whitelistlist": [
  53. {
  54. "name": "@jupyterlab/*",
  55. "type": "jupyterlab",
  56. "reason": "@jupyterlab-examples/launcher is blacklisted for test purpose - Do NOT take this for granted!!!",
  57. "creation_date": "2020-03-11T03:28:56.782Z",
  58. "last_update_date": "2020-03-11T03:28:56.782Z"
  59. }
  60. ]
  61. }
  62. Server Traits
  63. ~~~~~~~~~~~~~
  64. The administrator can use the following Traits to define the listings loading.
  65. - ``blacklist_uris``: A list of comma-separated URIs to get the blacklist
  66. - ``whitelist_uris``: A list of comma-separated URIs to get the whitelist
  67. - ``listings_refresh_ms``: The interval delay in milliseconds to refresh the lists
  68. - ``listings_request_options``: The optional kwargs to use for the listings HTTP requests
  69. Launch the server with e.g. ``--LabServerApp.blacklist_uris``.
  70. The details for the listings_request_options are listed
  71. on the `this page <https://2.python-requests.org/en/v2.7.0/api/#requests.request>`__
  72. (for example, you could pass ``{'timeout': 10}`` to change the HTTP request timeout value).