From 37c18ead99399ad34784edbefd6ddf08f826fe31 Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Fri, 3 Feb 2023 18:29:45 +0000 Subject: [PATCH] feat(backup): add in-memory backup --- selfprivacy_api/backup/providers/__init__.py | 7 +++++-- selfprivacy_api/graphql/queries/providers.py | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/selfprivacy_api/backup/providers/__init__.py b/selfprivacy_api/backup/providers/__init__.py index be09cb2..66fb9e6 100644 --- a/selfprivacy_api/backup/providers/__init__.py +++ b/selfprivacy_api/backup/providers/__init__.py @@ -2,10 +2,13 @@ from selfprivacy_api.graphql.queries.providers import BackupProvider from selfprivacy_api.backup.providers.provider import AbstractBackupProvider from selfprivacy_api.backup.providers.backblaze import Backblaze +from selfprivacy_api.backup.providers.memory import InMemoryBackup PROVIDER_MAPPING = { - BackupProvider.BACKBLAZE: Backblaze + BackupProvider.BACKBLAZE: Backblaze, + BackupProvider.MEMORY: InMemoryBackup, } -def get_provider(provider_type : BackupProvider) -> AbstractBackupProvider: + +def get_provider(provider_type: BackupProvider) -> AbstractBackupProvider: return PROVIDER_MAPPING[provider_type] diff --git a/selfprivacy_api/graphql/queries/providers.py b/selfprivacy_api/graphql/queries/providers.py index 1759d7b..ecc7f11 100644 --- a/selfprivacy_api/graphql/queries/providers.py +++ b/selfprivacy_api/graphql/queries/providers.py @@ -19,3 +19,5 @@ class ServerProvider(Enum): @strawberry.enum class BackupProvider(Enum): BACKBLAZE = "BACKBLAZE" + # for testing purposes, make sure not selectable in prod. + MEMORY = "MEMORY"