Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 29, 2024
1 parent 33dd355 commit 2362d8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
5 changes: 1 addition & 4 deletions oauthenticator/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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(
Expand Down Expand Up @@ -59,6 +57,5 @@ def _default_http_client(self):
)



class LocalGenericOAuthenticator(LocalAuthenticator, GenericOAuthenticator):
"""A version that mixes in local system user creation"""
15 changes: 13 additions & 2 deletions oauthenticator/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit 2362d8c

Please sign in to comment.