made AuthClient ABC for early error message

This commit is contained in:
2021-05-27 15:42:29 +02:00
parent 759f2af603
commit 6d207c1db9

View File

@ -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()