Skip to content

Commit 1063279

Browse files
committed
fix: use ClientAuth instead of RobotAuth in type annotations and in the documentation
1 parent 4596b25 commit 1063279

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

docs/user_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ respectively. The signature of the clients is always the same since they inherit
1414

1515
When initializing a client, there are some things to keep in mind.
1616

17-
* You *should* provide an instance of either :py:class:`.PasswordAuth` or :py:class:`.RobotAuth` to the ``auth``
17+
* You *should* provide an instance of either :py:class:`.PasswordAuth` or :py:class:`.ClientAuth` to the ``auth``
1818
argument as these are the two main authentication schemes supported by the FLAME Hub.
1919
* You *can* provide a custom ``base_url`` if you're hosting your own instance of the FLAME Hub, otherwise the client
2020
will use the default publicly available Hub instance https://privateaim.dev to connect to.

flame_hub/_auth_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
UNSET_T,
1919
)
2020
from flame_hub._defaults import DEFAULT_AUTH_BASE_URL
21-
from flame_hub._auth_flows import RobotAuth, PasswordAuth
21+
from flame_hub._auth_flows import ClientAuth, PasswordAuth
2222

2323

2424
class CreateRealm(BaseModel):
@@ -281,7 +281,7 @@ class AuthClient(BaseClient):
281281
def __init__(
282282
self,
283283
base_url=DEFAULT_AUTH_BASE_URL,
284-
auth: RobotAuth | PasswordAuth = None,
284+
auth: ClientAuth | PasswordAuth = None,
285285
**kwargs: te.Unpack[ClientKwargs],
286286
):
287287
super().__init__(base_url, auth, **kwargs)

flame_hub/_base_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pydantic import BaseModel, ValidatorFunctionWrapHandler, ValidationError, ConfigDict
1010

1111
from flame_hub._exceptions import new_hub_api_error_from_response
12-
from flame_hub._auth_flows import PasswordAuth, RobotAuth
12+
from flame_hub._auth_flows import PasswordAuth, ClientAuth
1313

1414

1515
class UNSET(BaseModel):
@@ -395,7 +395,7 @@ class BaseClient(object):
395395
----------
396396
base_url : :py:class:`str`
397397
Base URL of the Hub service.
398-
auth : :py:class:`.PasswordAuth` | :py:class:`.RobotAuth`, optional
398+
auth : :py:class:`.PasswordAuth` | :py:class:`.ClientAuth`, optional
399399
Authenticator which is used to authenticate the client at the FLAME Hub instance. Defaults to :any:`None`.
400400
**kwargs : :py:class:`Unpack`\\[:py:class:`~flame_hub._base_client.ClientKwargs`]
401401
Currently used to pass an already instantiated HTTP client via the ``client`` keyword argument to bypass the
@@ -406,7 +406,7 @@ class BaseClient(object):
406406
:py:class:`.AuthClient`, :py:class:`.CoreClient`, :py:class:`.StorageClient`
407407
"""
408408

409-
def __init__(self, base_url: str, auth: PasswordAuth | RobotAuth = None, **kwargs: te.Unpack[ClientKwargs]):
409+
def __init__(self, base_url: str, auth: PasswordAuth | ClientAuth = None, **kwargs: te.Unpack[ClientKwargs]):
410410
client = kwargs.get("client", None)
411411
# Set a read timeout of 20 seconds here because the endpoint for registry projects is slow.
412412
self._client = client or httpx.Client(auth=auth, base_url=base_url, timeout=httpx.Timeout(5, read=20))

flame_hub/_core_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
)
2525
from flame_hub._exceptions import new_hub_api_error_from_response
2626
from flame_hub._defaults import DEFAULT_CORE_BASE_URL
27-
from flame_hub._auth_flows import PasswordAuth, RobotAuth
27+
from flame_hub._auth_flows import PasswordAuth, ClientAuth
2828
from flame_hub._storage_client import Bucket, BucketFile
2929

3030
RegistryCommand = t.Literal["setup", "cleanup"]
@@ -390,7 +390,7 @@ class CoreClient(BaseClient):
390390
def __init__(
391391
self,
392392
base_url: str = DEFAULT_CORE_BASE_URL,
393-
auth: PasswordAuth | RobotAuth = None,
393+
auth: PasswordAuth | ClientAuth = None,
394394
**kwargs: te.Unpack[ClientKwargs],
395395
):
396396
super().__init__(base_url, auth, **kwargs)

flame_hub/_storage_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import typing_extensions as te
77
from pydantic import BaseModel
88

9-
from flame_hub._auth_flows import PasswordAuth, RobotAuth
9+
from flame_hub._auth_flows import PasswordAuth, ClientAuth
1010
from flame_hub._base_client import (
1111
BaseClient,
1212
ResourceList,
@@ -78,7 +78,7 @@ class StorageClient(BaseClient):
7878
def __init__(
7979
self,
8080
base_url: str = DEFAULT_STORAGE_BASE_URL,
81-
auth: PasswordAuth | RobotAuth = None,
81+
auth: PasswordAuth | ClientAuth = None,
8282
**kwargs: te.Unpack[ClientKwargs],
8383
):
8484
super().__init__(base_url, auth, **kwargs)

0 commit comments

Comments
 (0)