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

maint: cleanup 0.7 workaround and adjust two non-exposed func names #630

Merged
merged 2 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions oauthenticator/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,26 +197,6 @@ def get_next_url(self, user=None):
return super().get_next_url(user)
return url_path_join(self.hub.server.base_url, "home")

async def _login_user_pre_08(self):
"""login_user simplifies the login+cookie+auth_state process in JupyterHub 0.8

_login_user_07 is for backward-compatibility with JupyterHub 0.7
"""
user_info = await self.authenticator.get_authenticated_user(self, None)
if user_info is None:
return
if isinstance(user_info, dict):
username = user_info["name"]
else:
username = user_info
user = self.user_from_username(username)
self.set_login_cookie(user)
return user

if not hasattr(BaseHandler, "login_user"):
# JupyterHub 0.7 doesn't have .login_user
login_user = _login_user_pre_08

async def get(self):
self.check_arguments()
user = await self.login_user()
Expand Down Expand Up @@ -320,7 +300,7 @@ def _userdata_url_default(self):

# Enable refresh_pre_spawn by default if self.enable_auth_state
@default("refresh_pre_spawn")
def _refresh_pre_spawn(self):
def _refresh_pre_spawn_default(self):
if self.enable_auth_state:
return True

Expand Down
2 changes: 1 addition & 1 deletion oauthenticator/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def get_authenticator(generic_client):
),
],
)
async def test_generic_asd(
async def test_generic(
get_authenticator,
generic_client,
test_variation_id,
Expand Down