aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-05-30 13:04:27 +0300
committerFrederick Muriuki Muriithi2023-05-30 13:04:27 +0300
commit4e572eba5fa89a0ae4c5c732babe8c4bc011d435 (patch)
treeb06012589e9eb97fdaa3f3e559a6964c2bb9ae2b
parent7795c792d306d50e2254321889c4922f327f7587 (diff)
downloadgenenetwork3-4e572eba5fa89a0ae4c5c732babe8c4bc011d435.tar.gz
Fix linting errors and failing tests
* scripts/register_sys_admin.py: fix linting error * tests/unit/auth/fixtures/oauth2_client_fixtures.py: hash client secret in database. The code expects it hashed in the database.
-rw-r--r--scripts/register_sys_admin.py2
-rw-r--r--tests/unit/auth/fixtures/oauth2_client_fixtures.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/scripts/register_sys_admin.py b/scripts/register_sys_admin.py
index 2239fc9..1696adb 100644
--- a/scripts/register_sys_admin.py
+++ b/scripts/register_sys_admin.py
@@ -78,4 +78,4 @@ if __name__ == "__main__":
"""Entry-point for when script is run directly"""
return register_admin(Path(authdbpath).absolute())
- run()
+ run()# pylint: disable=[no-value-for-parameter]
diff --git a/tests/unit/auth/fixtures/oauth2_client_fixtures.py b/tests/unit/auth/fixtures/oauth2_client_fixtures.py
index 41d3ed4..654d048 100644
--- a/tests/unit/auth/fixtures/oauth2_client_fixtures.py
+++ b/tests/unit/auth/fixtures/oauth2_client_fixtures.py
@@ -6,6 +6,7 @@ import datetime
import pytest
from gn3.auth import db
+from gn3.auth.authentication.users import hash_password
from gn3.auth.authentication.oauth2.models.oauth2client import OAuth2Client
@pytest.fixture(autouse=True)
@@ -36,7 +37,7 @@ def fxtr_oauth2_clients(fxtr_users_with_passwords):
with db.cursor(conn) as cursor:
cursor.executemany(
"INSERT INTO oauth2_clients VALUES (?, ?, ?, ?, ?, ?)",
- ((str(client.client_id), client.client_secret,
+ ((str(client.client_id), hash_password(client.client_secret),
int(client.client_id_issued_at.timestamp()),
int(client.client_secret_expires_at.timestamp()),
json.dumps(client.client_metadata), str(client.user.user_id))