From 6d207c1db9e2bf58de5497b5cab6c50767d85996 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Thu, 27 May 2021 15:42:29 +0200 Subject: [PATCH] made AuthClient ABC for early error message --- scilog/authclient.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scilog/authclient.py b/scilog/authclient.py index 6c39762..f4273aa 100644 --- a/scilog/authclient.py +++ b/scilog/authclient.py @@ -1,4 +1,5 @@ import getpass +from abc import ABC, abstractmethod from .config import Config from .utils import typename @@ -9,7 +10,7 @@ AUTH_HEADERS = { } -class AuthClient: +class AuthClient(ABC): def __init__(self, address): self.address = address.rstrip("/") @@ -22,6 +23,10 @@ class AuthClient: return f"{tn} @ {self.address}" + @abstractmethod + def authenticate(self, username, password): + raise NotImplementedError + @property def auth_headers(self): headers = AUTH_HEADERS.copy()