5
5
from typing import TYPE_CHECKING , Any
6
6
7
7
import click
8
- from fief_client import Fief
9
- from fief_client .integrations .cli import FiefAuth , FiefAuthNotAuthenticatedError
10
8
11
- from silverback .cluster .settings import (
9
+ from .cluster .auth import Auth , AuthClient , NotAuthenticatedError
10
+ from .cluster .settings import (
12
11
PROFILE_PATH ,
13
12
BaseProfile ,
14
13
ClusterProfile ,
15
14
PlatformProfile ,
16
15
ProfileSettings ,
17
16
)
18
- from silverback .exceptions import ImportFromStringError
17
+ from .exceptions import ImportFromStringError
19
18
20
19
if TYPE_CHECKING :
21
20
from ape .contracts import ContractInstance
@@ -219,8 +218,8 @@ def add_auth(ctx: click.Context, *args, **kwargs):
219
218
220
219
if isinstance (profile , PlatformProfile ):
221
220
auth_info = settings .auth [profile .auth ]
222
- fief = Fief (auth_info .host , auth_info .client_id )
223
- ctx .obj ["auth" ] = FiefAuth ( fief , str (PROFILE_PATH .parent / f"{ profile .auth } .json" ))
221
+ client = AuthClient (auth_info .host , auth_info .client_id )
222
+ ctx .obj ["auth" ] = Auth ( client , str (PROFILE_PATH .parent / f"{ profile .auth } .json" ))
224
223
225
224
if expose_value :
226
225
kwargs ["auth" ] = ctx .obj ["auth" ]
@@ -245,10 +244,10 @@ def get_platform_client(ctx: click.Context, *args, **kwargs):
245
244
raise click .UsageError ("This command only works with the Silverback Platform" )
246
245
247
246
# NOTE: `auth` should be set if `profile` is set and is `PlatformProfile`
248
- auth : FiefAuth = ctx .obj ["auth" ]
247
+ auth : Auth = ctx .obj ["auth" ]
249
248
try :
250
249
userinfo = auth .current_user ()
251
- except FiefAuthNotAuthenticatedError as e :
250
+ except NotAuthenticatedError as e :
252
251
raise click .UsageError (
253
252
"Not authenticated, please use `silverback login` first."
254
253
) from e
0 commit comments