jupyterhub / jupyterhub/nativeauthenticator

Prepare for deprecation of Authenticator.db

Open
#207 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
81
Forks
68
PR merge metrics
No merged PRs in 30d

Description

JupyterHub will (not sure how soon) deprecate the `Authenticator.db` property, because the lifecycle of that property is a problem, and Authenticators and Spawners generally shouldn't ever need access to the JupyterHub db, and certainly shouldn't have access to a shared _session_ on that db.

xref: https://github.com/jupyterhub/jupyterhub/issues/3700

### Proposed change

Make NativeAuthenticator's db session independent of the Hub's internal db session. Creating a new Session against the same _database_ (i.e. starting from db_url instead of db) should be fine, especially since NativeAuthenticator's tables are already independent (related to #28, which I think crosses an internal implementation-detail line).

I think this may need some support from JupyterHub to get the necessary info. Worst case: duplicating db_url config from JupyterHub -> NativeAuthenticator. But since the _tables_ are independent, there's actually no reason other than convenience of configuration for the two to share the same db at all, let alone db session.

### Alternative options

- Wait for Authenticator.db to be removed, and stop working.
- Request new `db_session()` factory API to create a _session_ on the db that isn't shared with JupyterHub

### Who would use this feature?

All future deployments of JupyterHub with NativeAuthenticator

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.