Merge pull request #7 from yuvipanda/deleteuser

Clean password db when user is deleted
This commit is contained in:
Yuvi Panda 2018-09-04 11:20:52 -07:00 committed by GitHub
commit 1d3b95a7d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -65,3 +65,12 @@ class FirstUseAuthenticator(Authenticator):
else:
db[username] = bcrypt.hashpw(password.encode(), bcrypt.gensalt())
return username
def delete_user(self, user):
"""
When user is deleted, remove their entry from password db.
This lets passwords be reset by deleting users.
"""
with dbm.open(self.dbm_path, 'c', 0o600) as db:
del db[user.name]

View file

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name='jupyterhub-firstuseauthenticator',
version='0.10',
version='0.11',
description='JupyterHub Authenticator that lets users set passwords on first use',
url='https://github.com/yuvipanda/jupyterhub-firstuseauthenticator',
author='Yuvi Panda',