From cc970c499bcc1f756980ae46f7044e5ec9336c4f Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Tue, 3 Jul 2018 01:08:11 -0400 Subject: [PATCH] daemon/auth py3 conversion, this breaks the client for now --- lbrynet/daemon/__init__.py | 2 -- lbrynet/daemon/auth/server.py | 7 +++---- lbrynet/daemon/auth/util.py | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lbrynet/daemon/__init__.py b/lbrynet/daemon/__init__.py index c428bbb3b..297877dc8 100644 --- a/lbrynet/daemon/__init__.py +++ b/lbrynet/daemon/__init__.py @@ -1,4 +1,2 @@ from lbrynet import custom_logger import Components # register Component classes -from lbrynet.daemon.auth.client import LBRYAPIClient -get_client = LBRYAPIClient.get_client diff --git a/lbrynet/daemon/auth/server.py b/lbrynet/daemon/auth/server.py index 4315c7d92..f39a4357c 100644 --- a/lbrynet/daemon/auth/server.py +++ b/lbrynet/daemon/auth/server.py @@ -1,5 +1,5 @@ import logging -import urlparse +from six.moves.urllib import parse as urlparse import json import inspect import signal @@ -20,9 +20,8 @@ from lbrynet.core import utils from lbrynet.core.Error import ComponentsNotStarted, ComponentStartConditionNotMet from lbrynet.core.looping_call_manager import LoopingCallManager from lbrynet.daemon.ComponentManager import ComponentManager +from lbrynet.daemon.auth.util import APIKey, get_auth_message, LBRY_SECRET from lbrynet.undecorated import undecorated -from .util import APIKey, get_auth_message -from .client import LBRY_SECRET from .factory import AuthJSONRPCResource log = logging.getLogger(__name__) @@ -189,7 +188,7 @@ class AuthJSONRPCServer(AuthorizedBase): the server will randomize the shared secret and return the new value under the LBRY_SECRET header, which the client uses to generate the token for their next request. """ - implements(resource.IResource) + #implements(resource.IResource) isLeaf = True allowed_during_startup = [] diff --git a/lbrynet/daemon/auth/util.py b/lbrynet/daemon/auth/util.py index 7db751248..3e12d2b51 100644 --- a/lbrynet/daemon/auth/util.py +++ b/lbrynet/daemon/auth/util.py @@ -9,6 +9,7 @@ import logging log = logging.getLogger(__name__) API_KEY_NAME = "api" +LBRY_SECRET = "LBRY_SECRET" def sha(x):