From a31df05bb8935ea72e960461378138fe10fa8c12 Mon Sep 17 00:00:00 2001 From: Kharec Date: Sun, 14 Dec 2025 17:15:22 +0100 Subject: [PATCH] feat: define authentication logic to at protocol --- skywipe/auth.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 skywipe/auth.py diff --git a/skywipe/auth.py b/skywipe/auth.py new file mode 100644 index 0000000..f37ef82 --- /dev/null +++ b/skywipe/auth.py @@ -0,0 +1,25 @@ +"""Authentication module for Skywipe CLI.""" + +from atproto import Client +from skywipe.configure import Configuration + + +class Auth: + def __init__(self, configuration: Configuration = None): + self.configuration = configuration or Configuration() + self.client: Client = None + + def login(self) -> Client: + config_data = self.configuration.load() + + handle = config_data.get("handle") + password = config_data.get("password") + + if not handle or not password: + raise ValueError( + "handle and password must be set in configuration") + + self.client = Client() + self.client.login(handle, password) + + return self.client