Skip to content

Commit

Permalink
changed name for clitoken manager
Browse files Browse the repository at this point in the history
  • Loading branch information
ZohebShaikh committed Oct 17, 2024
1 parent 6456982 commit 86c6e94
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/blueapi/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
ConfigLoader,
)
from blueapi.core import DataEvent
from blueapi.service.authentication import CLITokenManager, SessionManager
from blueapi.service.authentication import CliTokenManager, SessionManager
from blueapi.service.main import start
from blueapi.service.openapi import (
DOCS_SCHEMA_LOCATION,
Expand Down Expand Up @@ -344,7 +344,7 @@ def login(obj: dict) -> None:
auth: SessionManager = SessionManager(
server_config=config.oauth_server,
client_config=config.oauth_client,
token_manager=CLITokenManager(Path(config.oauth_client.token_file_path)),
token_manager=CliTokenManager(Path(config.oauth_client.token_file_path)),
)
auth.start_device_flow()
else:
Expand All @@ -359,7 +359,7 @@ def logout(obj: dict) -> None:
auth: SessionManager = SessionManager(
server_config=config.oauth_server,
client_config=config.oauth_client,
token_manager=CLITokenManager(Path(config.oauth_client.token_file_path)),
token_manager=CliTokenManager(Path(config.oauth_client.token_file_path)),
)
auth.logout()
print("Logged out")
Expand Down
4 changes: 2 additions & 2 deletions src/blueapi/service/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def load_token(token) -> dict[str, Any] | None: ...
def delete_token(self): ...


class CLITokenManager(TokenManager):
class CliTokenManager(TokenManager):
def __init__(self, token_file_path: Path) -> None:
self._token_file_path: Path = token_file_path

Expand Down Expand Up @@ -117,7 +117,7 @@ def from_config(
return SessionManager(
server_config,
client_config,
CLITokenManager(Path(client_config.token_file_path)),
CliTokenManager(Path(client_config.token_file_path)),
)
return None

Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/client/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from blueapi.client.rest import BlueapiRestClient, BlueskyRemoteControlError
from blueapi.config import OAuthClientConfig, OAuthServerConfig
from blueapi.core.bluesky_types import Plan
from blueapi.service.authentication import CLITokenManager, SessionManager
from blueapi.service.authentication import CliTokenManager, SessionManager
from blueapi.service.model import PlanModel, PlanResponse


Expand Down Expand Up @@ -38,7 +38,7 @@ def rest(tmp_path: Path) -> BlueapiRestClient:
).decode("utf-8")
)
session_manager = SessionManager(
token_manager=CLITokenManager(tmp_path / "token"),
token_manager=CliTokenManager(tmp_path / "token"),
client_config=OAuthClientConfig(client_id="foo", client_audience="bar"),
server_config=OAuthServerConfig(oidc_config_url="http://example.com"),
)
Expand Down

0 comments on commit 86c6e94

Please sign in to comment.