yuvipanda / hubtraf

Traffic simulator for JupyterHub
BSD 3-Clause "New" or "Revised" License
40 stars 24 forks source link

Using a service instead of user for authentication to avoid login limitations #32

Open costrouc opened 3 years ago

costrouc commented 3 years ago

@yuvipanda was curious if you've explored using a service to create user notebooks and test the notebooks. Is there a limitation with the jupyterhub api that would prevent a service account being used for testing? As I understand hubtraf logs in as each user so social authentication would not be possible to automate. I've at least tried it out locally and it looks like I am able to access notebooks via the service account.

costrouc commented 3 years ago

We're looking to use hubtraf for qhub testing but don't want to have to downgrade the authentication for testing. Ideally we'd have a 'testing' service key via

c.JupyterHub.services = [
 {
        'name': 'my-service',
        'api_token': 'super-secret',
        'oauth_no_confirm': True,
        'admin': True
    }
]

And using this service to create n fake users, launch python kernels etc to run our tests and check that autoscalling is working properly.

yuvipanda commented 3 years ago

This would be great!

https://github.com/yuvipanda/hubtraf/blob/master/hubtraf/check.py lets you do this with the API, so you don't need to downgrade auth. Should be possible to easily extend this to simulate.py as well. Great PR to get started with? :D