credentials is too vague, and doesn't describe what kind of scheme is expected. Since the credentials are always base64 basic access credentials, we should change the name to reflect this. This is possibly a breaking change, and will require changes to HarborAsyncClient, utility functions such as utils.get_credentials, numerous tests, as well as many examples.
Despite the work required to change this name, it should be done, so that we have 3 distinct names for the different authentication methods.
To not break HarborAsyncClient, we can accept kwargs and issue a warning if credentials is used, and tell users to use the new basicauth instead:
class HarborAsyncClient:
def __init__(
self,
# ...
basicauth: Optional[str] = None,
# ...
**kwargs: Any,
) -> None:
# ...
elif basicauth or (credentials_kwarg := kwargs.get("credentials")):
if credentials_kwarg:
basicauth = credentials_kwarg
warnings.warn(
"parameter 'credentials' is deprecated and will be removed, use 'basicauth'",
DeprecationWarning,
)
self.basicauth = basicauth
credentials
is too vague, and doesn't describe what kind of scheme is expected. Since the credentials are always base64 basic access credentials, we should change the name to reflect this. This is possibly a breaking change, and will require changes toHarborAsyncClient
, utility functions such asutils.get_credentials
, numerous tests, as well as many examples.Despite the work required to change this name, it should be done, so that we have 3 distinct names for the different authentication methods.
To not break
HarborAsyncClient
, we can accept kwargs and issue a warning ifcredentials
is used, and tell users to use the newbasicauth
instead: