2024-06-14 18:46:02 +00:00
|
|
|
from abc import ABC, abstractmethod
|
2026-03-24 04:22:17 +00:00
|
|
|
from typing import Any
|
|
|
|
|
|
|
|
|
|
from typing_extensions import TypedDict
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AuthCredentials(TypedDict):
|
|
|
|
|
auth_type: str
|
|
|
|
|
config: dict[str, Any]
|
2024-06-14 18:46:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class ApiKeyAuthBase(ABC):
|
2026-03-24 04:22:17 +00:00
|
|
|
def __init__(self, credentials: AuthCredentials):
|
2024-06-14 18:46:02 +00:00
|
|
|
self.credentials = credentials
|
|
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
|
def validate_credentials(self):
|
|
|
|
|
raise NotImplementedError
|