diff --git a/oauthenticator/generic.py b/oauthenticator/generic.py index 20282ee9..93ef695a 100644 --- a/oauthenticator/generic.py +++ b/oauthenticator/generic.py @@ -3,12 +3,11 @@ """ import os -from functools import reduce from jupyterhub.auth import LocalAuthenticator from jupyterhub.traitlets import Callable from tornado.httpclient import AsyncHTTPClient -from traitlets import Bool, Dict, Set, Unicode, Union, default +from traitlets import Bool, Dict, Unicode, Union, default from .oauth2 import OAuthenticator @@ -18,7 +17,6 @@ class GenericOAuthenticator(OAuthenticator): def _login_service_default(self): return os.environ.get("LOGIN_SERVICE", "OAuth 2.0") - @default("http_client") def _default_http_client(self): return AsyncHTTPClient( @@ -59,6 +57,5 @@ def _default_http_client(self): ) - class LocalGenericOAuthenticator(LocalAuthenticator, GenericOAuthenticator): """A version that mixes in local system user creation""" diff --git a/oauthenticator/oauth2.py b/oauthenticator/oauth2.py index 5a6f1d46..33ad10a6 100644 --- a/oauthenticator/oauth2.py +++ b/oauthenticator/oauth2.py @@ -7,8 +7,8 @@ import base64 import json import os -from functools import reduce import uuid +from functools import reduce from urllib.parse import quote, urlencode, urlparse, urlunparse import jwt @@ -21,7 +21,18 @@ from tornado.httpclient import AsyncHTTPClient, HTTPClientError, HTTPRequest from tornado.httputil import url_concat from tornado.log import app_log -from traitlets import Any, Bool, Callable, Dict, List, Unicode, Union, Set, default, validate +from traitlets import ( + Any, + Bool, + Callable, + Dict, + List, + Set, + Unicode, + Union, + default, + validate, +) def guess_callback_uri(protocol, host, hub_server_url):