Skip to content

Commit

Permalink
refactor: Appease linter
Browse files Browse the repository at this point in the history
  • Loading branch information
emgrav committed Oct 17, 2023
1 parent e889359 commit 44e628b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion synapse_token_authenticator/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from synapse_token_authenticator.token_authenticator import TokenAuthenticator
from synapse_token_authenticator.token_authenticator import TokenAuthenticator # noqa: F401
4 changes: 2 additions & 2 deletions synapse_token_authenticator/token_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import synapse
from synapse.module_api import ModuleApi
from synapse.types import UserID, create_requester
from synapse.types import UserID

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -159,7 +159,7 @@ class _TokenAuthenticatorConfig(object):
raise Exception("Keyfile doesn't exist")

_config.algorithm = config.get("algorithm", "HS512")
if not _config.algorithm in [
if _config.algorithm not in [
"HS256",
"HS384",
"HS512",
Expand Down
4 changes: 1 addition & 3 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

from synapse.server import HomeServer
from synapse.module_api import ModuleApi
from synapse.handlers.auth import AuthHandler
from synapse.handlers.register import RegistrationHandler

admins = {}

Expand Down Expand Up @@ -81,7 +79,7 @@ def get_token(
claims.update({"admin": admin})

if exp_in != -1:
if exp_in == None:
if exp_in is None:
claims["exp"] = int(time.time()) + 120
else:
claims["exp"] = int(time.time()) + exp_in
Expand Down
1 change: 0 additions & 1 deletion tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from twisted.trial import unittest
from twisted.internet import defer
from . import get_auth_provider, get_token


Expand Down

0 comments on commit 44e628b

Please sign in to comment.