Coder Social home page Coder Social logo

zsailer / jupyter_authorized_server Goto Github PK

View Code? Open in Web Editor NEW
61.0 1.0 7.0 22 MB

Experimenting with adding authorization to Jupyter Server

License: BSD 3-Clause "New" or "Revised" License

Python 39.30% HTML 0.13% JavaScript 0.14% Jupyter Notebook 60.42%

jupyter_authorized_server's Introduction

Jupyter Server with Authorization

An experimental project adding authorization to Jupyter's core services. This allows multiple users to access the same Jupyter Server.

Adds an authorized wrapper (i.e. decorator) to Jupyter Server's tornado handlers to check which actions are allowed for the current_user.

The server's authorization layer is highly configurable. I don't make many decisions for you—keeping it as general as possible.

How?

Each handler in the Jupyter Server checks whether the current user is authorized the make the current request. This is determined by an user_is_authorized method in each RequestHandler. By default, this evaluates to True. You can patch this method in Jupyter Server's base handler, JupyterHandler, to implement your own authorization method.

There are three types of permissions: "read", "write" and "execute".

  • "read" refers to all GET and HEAD requests.
  • "write" refers to all PUT, PATCH, POST, and DELETE requests.
  • "execute" refers to all requests to ZMQ/Websocket channels.

Each of Jupyter Server's services are encoded to require one of the above permissions. Users without permission see a 401 error.

Each service is also encoded with a "resource-type" label, e.g. "contents", "kernels", "channels", etc. This enables finer grained access management. For example, this layer can be configured to allow users to change directories, read and execute notebooks, but not save any changes they make—behaving much like a temporary notebook server (see the examples folder).

Install

Clone from source, change into the base directory, and install using pip:

pip install -e .

Basic Example

Once you've installed the authorized server, try out the example in the example/ directory. You'll need NBClassic, a classic Jupyter Notebook frontend for Jupyter Server, to get test it out. Read the README there for more details.

jupyter_authorized_server's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.