Eliminated the Kernel and Kernelspec handlers. The Websocket (ZMQ)
channels handler still remains. This required turning a few methods
into coroutines in the Notebook server.
Renamed the Gateway config object to GatewayClient in case we want
to extend NB server (probably jupyter_server at that point) with
Gateway server functionality - so an NB server could be a Gateway
client or a server depending on launch settings.
Add code to _replace_ the channels handler rather than rely on position
within the handlers lists.
Updated mock-gateway to return the appropriate form of results.
Updated the session manager tests to use a sync ioloop to call the
now async manager methods.
Created a singleton class `Gateway` to store all configuration options
for a Gateway. This class also holds some help methods to make it easier
to use the options and determine if the gateway option is enabled.
Updated the NotebookTestBase class to allow for subclasses to infuence
the patched environment as well as command line options via argv.
Added a test to ensure various gateway configuration items can be
set via the environment or command-line.
This change alleviates a significant pain-point for consumers of Jupyter
Kernel and Enterprise Gateway projects by embedding the few classes defined
in the NB2KG server extension directly into the Notebook server. All code
resides in a separate gateway directory and the 'extension' is enabled
via a new configuration option `--gateway-url`.
Renamed classes from those used in standard NB2KG code so that Notebook
servers using the existing NB2KG extension will still work.
Added test_gateway.py to exercise overridden methods. It does this by
mocking the call that issues requests to the gateway server.
Updated the _Running a notebook server_ topic to include a description
of this feature.
- separates nbserver_extension config loading into new
init_server_extension_config method
- adds init_server_extension_config to the initialize funciton before
the init_webapp call
- adds nbserver_extension configuration found in config.d files (by the
BaseJSONConfigLoader) to both the underlying NotebookApp config object
and the self.nbserver_extensions value
- makes self.nbserver_extensions the canonical location for identifying
all nbserver_extensions rather than temporary extensions variable
This avoids putting the authentication token into a command-line
argument to launch the browser, where it's visible to other users.
Filesystem permissions should ensure that only the user who started the
notebook can use this route to authenticate.
Thanks to Dr Owain Kenway for suggesting this technique.
Currently the default URL message given on the console on startup is:
---
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://(myip.com or 127.0.0.1):8888/?token=8fdc8 ...
---
This will always need editing to use. Replace with one host IP (e.g. 'myip.com')
option and one local ip (127.0.0.1) option to make it copy/pastable again.
Currently the default URL message given on the console on startup is:
---
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://(myip.com or 127.0.0.1):8888/?token=8fdc8 ...
---
This will always need editing to use. Replace with host IP (e.g. 'myip.com')
to make it copy/pastable again.
Per Tornado's documentation:
>By default, Tornado’s secure cookies expire after 30 days.
>To change this, use the expires_days keyword argument to
>set_secure_cookie and the max_age_days argument to get_secure_cookie.
>These two values are passed separately so that you may
>e.g. have a cookie that is valid for 30 days for most purposes,
>but for certain sensitive actions
>(such as changing billing information)
>you use a smaller max_age_days when reading the cookie.
With the current implementation in `auth/login.py`,
this is possible to pass the `expires_days` option
but not possible to enforce it as this is not possible
to pass `max_age_days` to `get_secure_cookie`
This makes impossible to set the cookie expiration without
using a custom `LoginHandler`.
This revision is about adding the possibility to pass options
to Tornado's `get_secure_cookie` method,
so it can be possible to set the cookies expiration,
among others.
This commit introduces a new alias `custom_display_url` to override the
URL info displayed at launch with a custom string.
It is intended to be used when the app is run in an environment where
the url to display to the users is not detectable reliably (proxified or
containerized setups for example).
Noticed in test output that creating HMAC without digestmod arg is deprecated.
While there, use proper length of 32 bytes for default tornado cookie_secret. There’s no benefit to using a cookie secret that's longer that the cookie digest size, which is 32 bytes.