From fa360655fee5503db1475380fe00cd318e15f194 Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Wed, 19 Apr 2023 13:59:03 +0000 Subject: [PATCH] refactor(services): make local secret setting public --- selfprivacy_api/backup/local_secret.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/selfprivacy_api/backup/local_secret.py b/selfprivacy_api/backup/local_secret.py index 02d78a4..e04733c 100644 --- a/selfprivacy_api/backup/local_secret.py +++ b/selfprivacy_api/backup/local_secret.py @@ -23,10 +23,14 @@ class LocalBackupSecret: LocalBackupSecret.reset() return redis.get(REDIS_KEY) + @staticmethod + def set(secret: str): + redis.set(REDIS_KEY, secret) + @staticmethod def reset(): new_secret = LocalBackupSecret._generate() - LocalBackupSecret._store(new_secret) + LocalBackupSecret.set(new_secret) @staticmethod def exists() -> bool: @@ -35,7 +39,3 @@ class LocalBackupSecret: @staticmethod def _generate() -> str: return secrets.token_urlsafe(256) - - @staticmethod - def _store(secret: str): - redis.set(REDIS_KEY, secret)