I am running a Jupyter environment (Jupyter Lab) inside a Docker container on a remote server. Inside the container I want to restrict the OS level access from the jupyter lab such that the user must not be able to open or read any file from a specific directory of a folder.
Progress till now:
Approach: I have created a custom authorization class that inherits the jupyter_server.auth.Authorizer class and overrides it’s is_authorized method. The goal is that, the custom class must have a logic to restrict the access to a certain folder (for example: “D:\New folder (2)”), such that, every time a user tries to access that particular folder a HTTPError(403) error is raised, and the request must be blocked. The location of custom class is in the same directory as the jupyter_server_config.py config file i.e. “C:\Users\ashus\.jupyter”.
Inside config file:
c.ServerApp.authorizer_class = ‘C:\Users\ashus\.jupyter\CustomAuthorization.MyCustomAuthorizer’
Problem: When I run the Jupyter Lab using anaconda3 command prompt I am facing the following error:
This query is open for discussion and I would appreciate if the issue gets resolved through community support. Please add you comments and thoughts.