diracx-cli 0.0.1a42__tar.gz → 0.0.1a44__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/PKG-INFO +1 -1
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx/cli/auth.py +6 -1
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx/cli/utils.py +5 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx_cli.egg-info/PKG-INFO +1 -1
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/tests/test_login.py +5 -2
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/README.md +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/pyproject.toml +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/setup.cfg +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx/cli/__init__.py +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx/cli/__main__.py +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx/cli/config.py +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx/cli/internal/__init__.py +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx/cli/internal/config.py +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx/cli/internal/legacy.py +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx/cli/jobs.py +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx/cli/py.typed +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx_cli.egg-info/SOURCES.txt +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx_cli.egg-info/dependency_links.txt +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx_cli.egg-info/entry_points.txt +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx_cli.egg-info/requires.txt +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/src/diracx_cli.egg-info/top_level.txt +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/tests/legacy/cs_sync/integration_test.cfg +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/tests/legacy/cs_sync/integration_test.yaml +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/tests/legacy/cs_sync/integration_test_buggy.cfg +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/tests/legacy/cs_sync/integration_test_secret.cfg +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/tests/legacy/cs_sync/test_cssync.py +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/tests/legacy/test_legacy.py +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/tests/test_internal.py +0 -0
- {diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/tests/test_jobs.py +0 -0
|
@@ -124,7 +124,9 @@ async def logout():
|
|
|
124
124
|
|
|
125
125
|
# Revoke refresh token
|
|
126
126
|
try:
|
|
127
|
-
await api.auth.
|
|
127
|
+
await api.auth.revoke_refresh_token_by_refresh_token(
|
|
128
|
+
client_id=api.client_id, refresh_token=credentials.refresh_token
|
|
129
|
+
)
|
|
128
130
|
except Exception as e:
|
|
129
131
|
print(f"Error revoking the refresh token {e!r}")
|
|
130
132
|
pass
|
|
@@ -132,6 +134,9 @@ async def logout():
|
|
|
132
134
|
# Remove credentials
|
|
133
135
|
credentials_path.unlink(missing_ok=True)
|
|
134
136
|
print(f"Removed credentials from {credentials_path}")
|
|
137
|
+
else:
|
|
138
|
+
print("You are not connected to DiracX, or your credentials are missing.")
|
|
139
|
+
return
|
|
135
140
|
print("\nLogout successful!")
|
|
136
141
|
|
|
137
142
|
|
|
@@ -7,6 +7,7 @@ from functools import wraps
|
|
|
7
7
|
|
|
8
8
|
import typer
|
|
9
9
|
from azure.core.exceptions import ClientAuthenticationError
|
|
10
|
+
from httpx import ConnectError
|
|
10
11
|
from rich import print
|
|
11
12
|
|
|
12
13
|
|
|
@@ -22,6 +23,10 @@ class AsyncTyper(typer.Typer):
|
|
|
22
23
|
":x: [bold red]You are not authenticated. Log in with:[/bold red] "
|
|
23
24
|
"[bold] dirac login [OPTIONS] [VO] [/bold]"
|
|
24
25
|
)
|
|
26
|
+
except ConnectError:
|
|
27
|
+
print(
|
|
28
|
+
":x: [bold red]Please configure a valid DiracX server.[/bold red]"
|
|
29
|
+
)
|
|
25
30
|
|
|
26
31
|
self.command(*args, **kwargs)(sync_func)
|
|
27
32
|
return async_func
|
|
@@ -31,8 +31,11 @@ async def test_logout(monkeypatch, capfd, cli_env, with_cli_login):
|
|
|
31
31
|
# Rerun the logout command, it should not fail
|
|
32
32
|
await cli.auth.logout()
|
|
33
33
|
captured = capfd.readouterr()
|
|
34
|
-
assert
|
|
35
|
-
|
|
34
|
+
assert (
|
|
35
|
+
"You are not connected to DiracX, or your credentials are missing."
|
|
36
|
+
in captured.out
|
|
37
|
+
)
|
|
38
|
+
assert "Login successful!" not in captured.out
|
|
36
39
|
assert captured.err == ""
|
|
37
40
|
|
|
38
41
|
# Ensure the credentials file still does not exist
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{diracx_cli-0.0.1a42 → diracx_cli-0.0.1a44}/tests/legacy/cs_sync/integration_test_secret.cfg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|