aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uploader/authorisation.py2
-rw-r--r--uploader/db_utils.py2
-rw-r--r--uploader/oauth2/client.py6
3 files changed, 4 insertions, 6 deletions
diff --git a/uploader/authorisation.py b/uploader/authorisation.py
index efd4dbd..8ab83f8 100644
--- a/uploader/authorisation.py
+++ b/uploader/authorisation.py
@@ -1,11 +1,9 @@
"""Authorisation utilities."""
from functools import wraps
-from urllib.parse import urljoin
from flask import flash, redirect
from uploader import session
-from uploader.oauth2.client import oauth2_client, authserver_uri
def require_login(function):
"""Check that the user is logged in before executing `func`."""
diff --git a/uploader/db_utils.py b/uploader/db_utils.py
index 357b3da..5b79762 100644
--- a/uploader/db_utils.py
+++ b/uploader/db_utils.py
@@ -3,7 +3,7 @@ import logging
import traceback
import contextlib
from urllib.parse import urlparse
-from typing import Any, Tuple, Optional, Iterator, Callable
+from typing import Any, Tuple, Iterator, Callable
import MySQLdb as mdb
from redis import Redis
diff --git a/uploader/oauth2/client.py b/uploader/oauth2/client.py
index 6dde9cb..a3e4ba3 100644
--- a/uploader/oauth2/client.py
+++ b/uploader/oauth2/client.py
@@ -88,14 +88,14 @@ def oauth2_client():
"""Update the token when refreshed."""
session.set_user_token(token)
- def __json_auth__(client, method, uri, headers, body):
+ def __json_auth__(client, _method, uri, headers, body):
return (
uri,
{**headers, "Content-Type": "application/json"},
json.dumps({
**dict(url_decode(body)),
- "client_id": oauth2_clientid(),
- "client_secret": oauth2_clientsecret()
+ "client_id": client.client_id,
+ "client_secret": client.client_secret
}))
def __client__(token) -> OAuth2Session: