made AuthClient ABC for early error message
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
import getpass
|
import getpass
|
||||||
|
from abc import ABC, abstractmethod
|
||||||
from .config import Config
|
from .config import Config
|
||||||
from .utils import typename
|
from .utils import typename
|
||||||
|
|
||||||
@ -9,7 +10,7 @@ AUTH_HEADERS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class AuthClient:
|
class AuthClient(ABC):
|
||||||
|
|
||||||
def __init__(self, address):
|
def __init__(self, address):
|
||||||
self.address = address.rstrip("/")
|
self.address = address.rstrip("/")
|
||||||
@ -22,6 +23,10 @@ class AuthClient:
|
|||||||
return f"{tn} @ {self.address}"
|
return f"{tn} @ {self.address}"
|
||||||
|
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def authenticate(self, username, password):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def auth_headers(self):
|
def auth_headers(self):
|
||||||
headers = AUTH_HEADERS.copy()
|
headers = AUTH_HEADERS.copy()
|
||||||
|
Reference in New Issue
Block a user