frostfs-testlib/src/frostfs_testlib/credentials/interfaces.py
Andrey Berezin 09a7f66d1e [#188] Add CredentialsProvider
Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
2024-03-01 02:18:05 +03:00

25 lines
705 B
Python

from abc import abstractmethod
from frostfs_testlib.plugins import load_plugin
from frostfs_testlib.storage.cluster import ClusterNode
class S3CredentialsProvider(object):
stash: dict
def __init__(self, stash: dict) -> None:
self.stash = stash
@abstractmethod
def provide(self, cluster_node: ClusterNode) -> tuple[str, str]:
raise NotImplementedError("Directly called abstract class?")
class CredentialsProvider(object):
stash: dict
S3: S3CredentialsProvider
def __init__(self, s3_plugin_name: str) -> None:
self.stash = {}
s3cls = load_plugin("frostfs.testlib.credentials_providers", s3_plugin_name)
self.S3 = s3cls(self.stash)