Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated jupyterhub_config.py has whitelist error #885

Closed
hokiegeek2 opened this issue Nov 24, 2016 · 6 comments · Fixed by #896
Closed

Generated jupyterhub_config.py has whitelist error #885

hokiegeek2 opened this issue Nov 24, 2016 · 6 comments · Fixed by #896

Comments

@hokiegeek2
Copy link

Hi Everyone,

Minor issue with jupyterhub_config.py that is generated by jupyterhub command. The string is as follows:
#c.Authenticator.whitelist = set('')

This causes all user logins to fail. When I changed it to the following--which is on the Getting Started page--the whitelist worked as expected:
c.Authenticator.whitelist = {''}

Again, minor issue, but it may trip up Python newbies. :)

--John

@minrk
Copy link
Member

minrk commented Nov 25, 2016

How did you run the config generation? This is what I get:

#c.Authenticator.whitelist = set()

which is correct.

@willingc
Copy link
Contributor

Hi @hokiegeek2,

Thanks for the issue report. I'm getting the same results as @minrk for Python 3.5 (as a reminder JupyterHub runs on Python3). Out of curiousity, how did you install JupyterHub? Perhaps there was already a config file in your environment.

I'm going to go ahead and close this issue since we can't replicate it. If you have additional information, I would be happy to look into it.

Thanks! - Carol

@hokiegeek2
Copy link
Author

Hey Everyone,

I apologize for the delay in following up on this. @minrk Yes, the config generation results in this format. However, when I manually set the users in this data structure:
c.Authenticator.whitelist = set('hokiegeek2')
I get this message:
[W 2016-12-03 23:25:36.672 JupyterHub auth:138] User 'hokiegeek2' not in whitelist.

When I switch to this, the whitelist filter works correctly:
c.Authenticator.whitelist = {'hokiegeek2'}

--John

@willingc willingc reopened this Dec 4, 2016
@willingc
Copy link
Contributor

willingc commented Dec 4, 2016

Thanks for the update @hokiegeek2.

@minrk Do we want to edit the comment about whitelist and/or add a note in the docs?

@minrk
Copy link
Member

minrk commented Dec 5, 2016

set('hokiegeek2'), like list('hokiegeek2'), treats the string as a collection and transforms each item (character) in the string to an item in the set, so what you get is {'h', 'o', 'k', 'i', ...} instead of {'hokiegeek1'}. If you wanted to create that single-item set with the set() constructor, you would do set(['hokiegeek1']).

I've opened #885 to give a more informative message when it sees that a whitelist contains single-character usernames.

@willingc
Copy link
Contributor

willingc commented Dec 5, 2016

Thanks @minrk 🍪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants