main commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-10-16 16:30:25 +09:00
parent 91c7e04474
commit 537e7b363f
1146 changed files with 45926 additions and 77196 deletions

View File

@@ -1,8 +1,4 @@
import logging
from abc import ABC, abstractmethod
from typing import Any, Callable, Optional, Tuple, Union
logger = logging.getLogger(__name__)
from typing import Optional, Tuple, Union
class CredentialProvider:
@@ -13,38 +9,6 @@ class CredentialProvider:
def get_credentials(self) -> Union[Tuple[str], Tuple[str, str]]:
raise NotImplementedError("get_credentials must be implemented")
async def get_credentials_async(self) -> Union[Tuple[str], Tuple[str, str]]:
logger.warning(
"This method is added for backward compatability. "
"Please override it in your implementation."
)
return self.get_credentials()
class StreamingCredentialProvider(CredentialProvider, ABC):
"""
Credential provider that streams credentials in the background.
"""
@abstractmethod
def on_next(self, callback: Callable[[Any], None]):
"""
Specifies the callback that should be invoked
when the next credentials will be retrieved.
:param callback: Callback with
:return:
"""
pass
@abstractmethod
def on_error(self, callback: Callable[[Exception], None]):
pass
@abstractmethod
def is_streaming(self) -> bool:
pass
class UsernamePasswordCredentialProvider(CredentialProvider):
"""
@@ -60,6 +24,3 @@ class UsernamePasswordCredentialProvider(CredentialProvider):
if self.username:
return self.username, self.password
return (self.password,)
async def get_credentials_async(self) -> Union[Tuple[str], Tuple[str, str]]:
return self.get_credentials()