idiap / multiauthenticator

JupyterHub authenticator muxer that allows to use more than one authentication backend to access an instance.
1 stars 6 forks source link

allow dict-based config instead of tuples? #34

Open minrk opened 3 hours ago

minrk commented 3 hours ago

The list of authenticators is currently a list of 3-tuples (authenticator, url_prefix, config). This is hard to extend if there are going to be more options in the future, optional fields, etc. And thinking about deploying this in the jupyterhub helm chart, a list of lists looks like:

-
  - google
  - /google
  - client_id: XXXX
    client_secret: YYYY
    oauth_callback_url: https://jupyterhub.example.com/hub/google/oauth_callback
-
  - google
  - /google
  - client_id: XXXX
    client_secret: YYYY
    oauth_callback_url: https://jupyterhub.example.com/hub/google/oauth_callback

which is not the clearest, and not everyone knows how to enter a list of lists in yaml.

whereas if they were dicts, it might look like:

- authenticator_class: github
  url_prefix: /github
  config:
    client_id: XXXX
    client_secret: YYYY
    oauth_callback_url: https://jupyterhub.example.com/hub/github/oauth_callback
- authenticator_class: google
  url_prefix: /google
  config:
    client_id: XXXX
    client_secret: YYYY
    oauth_callback_url: https://jupyterhub.example.com/hub/google/oauth_callback

which I think is clearer and has the benefit of much simpler behavior for new and optional fields. WDYT @sgaist?

sgaist commented 3 hours ago

I think you have an excellent point here.

That would be a very good update to the current implementation.