fastapi-cloud-cli 0.27.1__tar.gz → 0.28.0__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.
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/PKG-INFO +3 -1
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/pyproject.toml +4 -1
- fastapi_cloud_cli-0.28.0/src/fastapi_cloud_cli/__init__.py +1 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/api/_errors.py +1 -1
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/api/client.py +8 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/_auth.py +3 -1
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/_flow.py +11 -4
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/apps/link.py +3 -1
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/deploy/command.py +4 -2
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/login.py +0 -10
- fastapi_cloud_cli-0.28.0/src/fastapi_cloud_cli/commands/logout.py +67 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/auth.py +11 -68
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/conftest.py +8 -3
- fastapi_cloud_cli-0.28.0/tests/test_auth.py +59 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_cli_deploy.py +20 -4
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_cli_link.py +16 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_cli_login.py +118 -22
- fastapi_cloud_cli-0.28.0/tests/test_cli_logout.py +185 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_cli_whoami.py +40 -1
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/utils.py +3 -0
- fastapi_cloud_cli-0.27.1/src/fastapi_cloud_cli/__init__.py +0 -1
- fastapi_cloud_cli-0.27.1/src/fastapi_cloud_cli/commands/logout.py +0 -32
- fastapi_cloud_cli-0.27.1/tests/test_auth.py +0 -112
- fastapi_cloud_cli-0.27.1/tests/test_cli_logout.py +0 -54
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/LICENSE +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/README.md +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/scripts/add_latest_release_date.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/scripts/format.sh +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/scripts/lint.sh +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/scripts/prepare_release.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/scripts/test-cov-html.sh +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/scripts/test.sh +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/__main__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/_app.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/api/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/api/_models.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/api/_retry.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/cli.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/apps/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/apps/_app.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/apps/create.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/apps/get.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/apps/list.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/apps/unlink.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/apps/update.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/auth/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/auth/_app.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/auth/wait.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/ci/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/ci/_app.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/ci/print_workflow.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/deploy/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/deploy/archive.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/deploy/cloud.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/deploy/configure.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/deploy/upload.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/deploy/wait.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/deployments.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/domains/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/domains/_app.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/domains/_setup.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/domains/_shared.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/domains/add.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/domains/get.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/domains/list.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/domains/remove.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/domains/rendering.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/domains/restart.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/env/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/env/_app.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/env/_shared.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/env/delete.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/env/get.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/env/list.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/env/set.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/integrations/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/integrations/providers/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/integrations/providers/_app.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/integrations/providers/list.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/integrations/resources/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/integrations/resources/_app.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/integrations/resources/connect.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/integrations/resources/disconnect.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/integrations/resources/get.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/integrations/resources/list.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/integrations/resources/providers.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/logs.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/setup_ci.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/teams/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/teams/_app.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/teams/get.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/teams/list.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/tokens/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/tokens/_app.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/tokens/create.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/tokens/delete.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/tokens/list.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/whoami.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/config.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/logging.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/py.typed +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/apps.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/build_logs.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/cli.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/config.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/dates.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/env.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/errors.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/execution.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/progress_file.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/sentry.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/teams.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/utils/version_check.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/domains/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/domains/test_cli.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/domains/test_setup.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/integrations/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/integrations/providers/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/integrations/providers/test_list.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/integrations/resources/__init__.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/integrations/resources/test_connect.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/integrations/resources/test_disconnect.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/integrations/resources/test_get.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/integrations/resources/test_list.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_api_client.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_archive.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_cli.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_cli_apps.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_cli_ci.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_cli_deployments.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_cli_setup_ci.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_cli_teams.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_cli_tokens.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_cli_unlink.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_config.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_dates.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_deploy_utils.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_env_delete.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_env_get.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_env_list.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_env_set.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_logs.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_prepare_release.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_progress_file.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_sentry.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_utils_apps.py +0 -0
- {fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/tests/test_version_check.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fastapi-cloud-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.28.0
|
|
4
4
|
Summary: Deploy and manage FastAPI Cloud apps from the command line 🚀
|
|
5
5
|
Author-Email: Patrick Arminio <patrick@fastapilabs.com>
|
|
6
6
|
License: MIT
|
|
@@ -23,6 +23,8 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.11
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.12
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
26
28
|
Project-URL: Homepage, https://github.com/fastapilabs/fastapi-cloud-cli
|
|
27
29
|
Project-URL: Documentation, https://fastapi.tiangolo.com/fastapi-cloud-cli/
|
|
28
30
|
Project-URL: Repository, https://github.com/fastapilabs/fastapi-cloud-cli
|
|
@@ -27,6 +27,8 @@ classifiers = [
|
|
|
27
27
|
"Programming Language :: Python :: 3.11",
|
|
28
28
|
"Programming Language :: Python :: 3.12",
|
|
29
29
|
"Programming Language :: Python :: 3.13",
|
|
30
|
+
"Programming Language :: Python :: 3.14",
|
|
31
|
+
"Programming Language :: Python :: 3.15",
|
|
30
32
|
]
|
|
31
33
|
dependencies = [
|
|
32
34
|
"typer >= 0.26.1",
|
|
@@ -42,7 +44,7 @@ dependencies = [
|
|
|
42
44
|
"detect-installer>=0.1.0",
|
|
43
45
|
"agent-detector>=1.1.0",
|
|
44
46
|
]
|
|
45
|
-
version = "0.
|
|
47
|
+
version = "0.28.0"
|
|
46
48
|
|
|
47
49
|
[project.license]
|
|
48
50
|
text = "MIT"
|
|
@@ -107,6 +109,7 @@ junit_family = "xunit2"
|
|
|
107
109
|
format-command = "ruff format --stdin-filename {filename}"
|
|
108
110
|
|
|
109
111
|
[tool.coverage.run]
|
|
112
|
+
core = "ctrace"
|
|
110
113
|
parallel = true
|
|
111
114
|
data_file = "coverage/.coverage"
|
|
112
115
|
source = [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.28.0"
|
|
@@ -27,7 +27,7 @@ def _handle_unauthorized(auth_mode: AuthMode) -> str:
|
|
|
27
27
|
if auth_mode == "user":
|
|
28
28
|
delete_auth_config()
|
|
29
29
|
|
|
30
|
-
message += "
|
|
30
|
+
message += "Run `fastapi cloud login` to generate a new token."
|
|
31
31
|
else:
|
|
32
32
|
message += "Make sure to use a valid token."
|
|
33
33
|
|
|
@@ -211,6 +211,14 @@ class APIClient(httpx.Client):
|
|
|
211
211
|
|
|
212
212
|
return CustomDomain.model_validate(response.json())
|
|
213
213
|
|
|
214
|
+
def logout(self) -> None:
|
|
215
|
+
"""Revoke the token this client sends."""
|
|
216
|
+
# Short, so logging out doesn't hang when FastAPI Cloud is slow.
|
|
217
|
+
response = self.post("/logout", timeout=5)
|
|
218
|
+
# FastAPI Cloud without /logout can't revoke tokens, so there's nothing to do.
|
|
219
|
+
if response.status_code != 404:
|
|
220
|
+
response.raise_for_status()
|
|
221
|
+
|
|
214
222
|
@attempts(STREAM_LOGS_MAX_RETRIES, STREAM_LOGS_TIMEOUT)
|
|
215
223
|
def stream_build_logs(
|
|
216
224
|
self, deployment_id: str, *, follow: bool = True
|
{fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/_auth.py
RENAMED
|
@@ -30,7 +30,9 @@ class UserCommand(TyperCommand):
|
|
|
30
30
|
if not identity.is_logged_in():
|
|
31
31
|
toolkit.fail(
|
|
32
32
|
"not_logged_in",
|
|
33
|
-
"
|
|
33
|
+
"Your session has expired."
|
|
34
|
+
if identity.is_user_token_expired()
|
|
35
|
+
else "No credentials found.",
|
|
34
36
|
hint="Run `fastapi cloud login`.",
|
|
35
37
|
)
|
|
36
38
|
|
{fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/_flow.py
RENAMED
|
@@ -26,6 +26,7 @@ class AuthorizationData(BaseModel):
|
|
|
26
26
|
|
|
27
27
|
class TokenResponse(BaseModel):
|
|
28
28
|
access_token: str
|
|
29
|
+
expires_in: int | None = None
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
class LoginOutput(BaseModel):
|
|
@@ -85,7 +86,7 @@ def fetch_access_token(
|
|
|
85
86
|
device_code: str,
|
|
86
87
|
interval: int,
|
|
87
88
|
timeout: int = DEFAULT_LOGIN_TIMEOUT_SECONDS,
|
|
88
|
-
) ->
|
|
89
|
+
) -> TokenResponse:
|
|
89
90
|
settings = Settings.get()
|
|
90
91
|
start = time.monotonic()
|
|
91
92
|
|
|
@@ -130,7 +131,7 @@ def fetch_access_token(
|
|
|
130
131
|
response_data = TokenResponse.model_validate_json(response.text)
|
|
131
132
|
logger.debug("Access token received successfully.")
|
|
132
133
|
|
|
133
|
-
return response_data
|
|
134
|
+
return response_data
|
|
134
135
|
|
|
135
136
|
|
|
136
137
|
def complete_device_login(
|
|
@@ -145,7 +146,7 @@ def complete_device_login(
|
|
|
145
146
|
) -> LoginOutput:
|
|
146
147
|
try:
|
|
147
148
|
with client.handle_http_errors(progress, toolkit=toolkit):
|
|
148
|
-
|
|
149
|
+
token = fetch_access_token(client, device_code, interval, timeout)
|
|
149
150
|
except LoginDeniedError:
|
|
150
151
|
toolkit.fail(
|
|
151
152
|
"permission_denied",
|
|
@@ -167,6 +168,12 @@ def complete_device_login(
|
|
|
167
168
|
hint=cancel_hint,
|
|
168
169
|
)
|
|
169
170
|
|
|
170
|
-
|
|
171
|
+
expires_at = None
|
|
172
|
+
if token.expires_in is not None:
|
|
173
|
+
expires_at = int(time.time()) + token.expires_in
|
|
174
|
+
|
|
175
|
+
write_auth_config(
|
|
176
|
+
AuthConfig(access_token=token.access_token, expires_at=expires_at)
|
|
177
|
+
)
|
|
171
178
|
|
|
172
179
|
return LoginOutput(authenticated=True, auth_mode="user")
|
|
@@ -217,7 +217,9 @@ def deploy(
|
|
|
217
217
|
if json_output:
|
|
218
218
|
toolkit.fail(
|
|
219
219
|
"not_logged_in",
|
|
220
|
-
"
|
|
220
|
+
"Your session has expired."
|
|
221
|
+
if identity.is_user_token_expired()
|
|
222
|
+
else "No credentials found.",
|
|
221
223
|
hint="Run `fastapi cloud login` or set FASTAPI_CLOUD_TOKEN.",
|
|
222
224
|
)
|
|
223
225
|
|
|
@@ -229,7 +231,7 @@ def deploy(
|
|
|
229
231
|
)
|
|
230
232
|
toolkit.print_line()
|
|
231
233
|
|
|
232
|
-
if identity.
|
|
234
|
+
if identity.is_user_token_expired():
|
|
233
235
|
toolkit.print("Your session has expired. Please log in again.")
|
|
234
236
|
else:
|
|
235
237
|
toolkit.print("You need to be logged in to deploy to FastAPI Cloud.")
|
{fastapi_cloud_cli-0.27.1 → fastapi_cloud_cli-0.28.0}/src/fastapi_cloud_cli/commands/login.py
RENAMED
|
@@ -103,16 +103,6 @@ def login(
|
|
|
103
103
|
toolkit.print_title("Login to FastAPI Cloud", tag="FastAPI Cloud", emoji="🔐")
|
|
104
104
|
toolkit.print_line()
|
|
105
105
|
|
|
106
|
-
if identity.is_logged_in():
|
|
107
|
-
toolkit.print("You are already logged in.")
|
|
108
|
-
toolkit.print_line()
|
|
109
|
-
toolkit.print(
|
|
110
|
-
"Run [bold]fastapi cloud logout[/bold] first if you want to switch accounts.",
|
|
111
|
-
emoji="💡",
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
return
|
|
115
|
-
|
|
116
106
|
if identity.has_deploy_token():
|
|
117
107
|
toolkit.print(
|
|
118
108
|
"You have [bold blue]FASTAPI_CLOUD_TOKEN[/] environment variable set.\n"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import Annotated, Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
from pydantic import BaseModel, Field
|
|
6
|
+
from rich_toolkit import RichToolkit
|
|
7
|
+
|
|
8
|
+
from fastapi_cloud_cli._app import cloud_app
|
|
9
|
+
from fastapi_cloud_cli.api import APIClient
|
|
10
|
+
from fastapi_cloud_cli.utils.auth import Identity, delete_auth_config
|
|
11
|
+
from fastapi_cloud_cli.utils.cli import get_rich_toolkit
|
|
12
|
+
from fastapi_cloud_cli.utils.execution import JsonOutputOption
|
|
13
|
+
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class LogoutOutput(BaseModel):
|
|
18
|
+
logged_out: bool
|
|
19
|
+
revoke_failed: Annotated[bool, Field(exclude=True)] = False
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
REVOKE_FAILED_MESSAGE = (
|
|
23
|
+
"Couldn't sign out on FastAPI Cloud, so this login stays valid until it expires."
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _render_logout_output(data: LogoutOutput, toolkit: RichToolkit) -> None:
|
|
28
|
+
toolkit.print_title("FastAPI Cloud")
|
|
29
|
+
toolkit.print_line()
|
|
30
|
+
toolkit.print("You are now logged out!", emoji="👋")
|
|
31
|
+
|
|
32
|
+
if data.revoke_failed:
|
|
33
|
+
toolkit.print_line()
|
|
34
|
+
toolkit.print(REVOKE_FAILED_MESSAGE, emoji="⚠️")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@cloud_app.command()
|
|
38
|
+
def logout(json_output: JsonOutputOption = False) -> Any:
|
|
39
|
+
"""
|
|
40
|
+
Logout from FastAPI Cloud.
|
|
41
|
+
"""
|
|
42
|
+
with get_rich_toolkit(json_output=json_output) as toolkit:
|
|
43
|
+
revoke_failed = False
|
|
44
|
+
|
|
45
|
+
if Identity().user_token:
|
|
46
|
+
# Revoke the token on a best-effort basis: logging out must still
|
|
47
|
+
# work when FastAPI Cloud can't be reached.
|
|
48
|
+
try:
|
|
49
|
+
with APIClient() as client:
|
|
50
|
+
client.logout()
|
|
51
|
+
except httpx.HTTPError as e:
|
|
52
|
+
logger.debug("Could not revoke the token: %s", e)
|
|
53
|
+
revoke_failed = True
|
|
54
|
+
|
|
55
|
+
delete_auth_config()
|
|
56
|
+
|
|
57
|
+
warnings = []
|
|
58
|
+
if revoke_failed:
|
|
59
|
+
warnings.append(
|
|
60
|
+
{"code": "token_not_revoked", "message": REVOKE_FAILED_MESSAGE}
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
toolkit.success(
|
|
64
|
+
LogoutOutput(logged_out=True, revoke_failed=revoke_failed),
|
|
65
|
+
warnings=warnings,
|
|
66
|
+
render_output=_render_logout_output,
|
|
67
|
+
)
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import base64
|
|
2
|
-
import binascii
|
|
3
|
-
import json
|
|
4
1
|
import logging
|
|
5
2
|
import os
|
|
6
3
|
import time
|
|
@@ -17,6 +14,8 @@ AuthMode = Literal["token", "user"]
|
|
|
17
14
|
|
|
18
15
|
class AuthConfig(BaseModel):
|
|
19
16
|
access_token: str
|
|
17
|
+
# Unix time when FastAPI Cloud expires the token. Older logins didn't save it.
|
|
18
|
+
expires_at: int | None = None
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
def write_auth_config(auth_data: AuthConfig) -> None:
|
|
@@ -50,69 +49,11 @@ def read_auth_config() -> AuthConfig | None:
|
|
|
50
49
|
return AuthConfig.model_validate_json(auth_path.read_text(encoding="utf-8"))
|
|
51
50
|
|
|
52
51
|
|
|
53
|
-
def _get_auth_token() -> str | None:
|
|
54
|
-
logger.debug("Getting auth token")
|
|
55
|
-
auth_data = read_auth_config()
|
|
56
|
-
|
|
57
|
-
if auth_data is None:
|
|
58
|
-
logger.debug("No auth data found")
|
|
59
|
-
return None
|
|
60
|
-
|
|
61
|
-
logger.debug("Auth token retrieved successfully")
|
|
62
|
-
return auth_data.access_token
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
def _is_jwt_expired(token: str) -> bool:
|
|
66
|
-
try:
|
|
67
|
-
parts = token.split(".")
|
|
68
|
-
|
|
69
|
-
if len(parts) != 3:
|
|
70
|
-
logger.debug("Invalid JWT format: expected 3 parts, got %d", len(parts))
|
|
71
|
-
return True
|
|
72
|
-
|
|
73
|
-
payload = parts[1]
|
|
74
|
-
|
|
75
|
-
# Add padding if needed (JWT uses base64url encoding without padding)
|
|
76
|
-
if padding := len(payload) % 4:
|
|
77
|
-
payload += "=" * (4 - padding)
|
|
78
|
-
|
|
79
|
-
payload = payload.replace("-", "+").replace("_", "/")
|
|
80
|
-
decoded_bytes = base64.b64decode(payload)
|
|
81
|
-
payload_data = json.loads(decoded_bytes)
|
|
82
|
-
|
|
83
|
-
exp = payload_data.get("exp")
|
|
84
|
-
|
|
85
|
-
if exp is None:
|
|
86
|
-
logger.debug("No 'exp' claim found in token")
|
|
87
|
-
|
|
88
|
-
return False
|
|
89
|
-
|
|
90
|
-
if not isinstance(exp, int): # pragma: no cover
|
|
91
|
-
logger.debug("Invalid 'exp' claim: expected int, got %s", type(exp))
|
|
92
|
-
|
|
93
|
-
return True
|
|
94
|
-
|
|
95
|
-
current_time = time.time()
|
|
96
|
-
|
|
97
|
-
is_expired = current_time >= exp
|
|
98
|
-
|
|
99
|
-
logger.debug(
|
|
100
|
-
"Token expiration check: current=%d, exp=%d, expired=%s",
|
|
101
|
-
current_time,
|
|
102
|
-
exp,
|
|
103
|
-
is_expired,
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
return is_expired
|
|
107
|
-
except (binascii.Error, json.JSONDecodeError) as e:
|
|
108
|
-
logger.debug("Error parsing JWT token: %s", e)
|
|
109
|
-
|
|
110
|
-
return True
|
|
111
|
-
|
|
112
|
-
|
|
113
52
|
class Identity:
|
|
114
53
|
def __init__(self) -> None:
|
|
115
|
-
|
|
54
|
+
auth_config = read_auth_config()
|
|
55
|
+
self._user_token = auth_config.access_token if auth_config else None
|
|
56
|
+
self._user_token_expires_at = auth_config.expires_at if auth_config else None
|
|
116
57
|
self._deploy_token: str | None = os.environ.get("FASTAPI_CLOUD_TOKEN")
|
|
117
58
|
|
|
118
59
|
@property
|
|
@@ -124,13 +65,14 @@ class Identity:
|
|
|
124
65
|
return self._deploy_token
|
|
125
66
|
|
|
126
67
|
def is_user_token_expired(self) -> bool:
|
|
127
|
-
|
|
128
|
-
|
|
68
|
+
# Without a saved expiry, only FastAPI Cloud can tell, with a 401.
|
|
69
|
+
if self._user_token_expires_at is None:
|
|
70
|
+
return False
|
|
129
71
|
|
|
130
|
-
return
|
|
72
|
+
return time.time() >= self._user_token_expires_at
|
|
131
73
|
|
|
132
74
|
def is_logged_in(self) -> bool:
|
|
133
|
-
if self._user_token
|
|
75
|
+
if not self._user_token:
|
|
134
76
|
logger.debug("Login status: False (no token)")
|
|
135
77
|
return False
|
|
136
78
|
|
|
@@ -138,6 +80,7 @@ class Identity:
|
|
|
138
80
|
logger.debug("Login status: False (token expired)")
|
|
139
81
|
return False
|
|
140
82
|
|
|
83
|
+
# A revoked token still gets a 401, which deletes the stored token.
|
|
141
84
|
logger.debug("Login status: True")
|
|
142
85
|
return True
|
|
143
86
|
|
|
@@ -11,7 +11,7 @@ from typer import rich_utils
|
|
|
11
11
|
|
|
12
12
|
from fastapi_cloud_cli.config import Settings
|
|
13
13
|
|
|
14
|
-
from .utils import
|
|
14
|
+
from .utils import USER_TOKEN
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
@pytest.fixture(autouse=True)
|
|
@@ -67,9 +67,14 @@ def respx_mock(settings: Settings) -> Generator[respx.MockRouter, None, None]:
|
|
|
67
67
|
|
|
68
68
|
@pytest.fixture
|
|
69
69
|
def logged_in_cli(temp_auth_config: Path) -> Generator[None, None, None]:
|
|
70
|
-
|
|
70
|
+
temp_auth_config.write_text(f'{{"access_token": "{USER_TOKEN}"}}')
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
yield
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@pytest.fixture
|
|
76
|
+
def logged_in_with_expired_token(temp_auth_config: Path) -> Generator[None, None, None]:
|
|
77
|
+
temp_auth_config.write_text(f'{{"access_token": "{USER_TOKEN}", "expires_at": 0}}')
|
|
73
78
|
|
|
74
79
|
yield
|
|
75
80
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import time
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from fastapi_cloud_cli.utils.auth import AuthConfig, Identity, write_auth_config
|
|
5
|
+
|
|
6
|
+
from .utils import USER_TOKEN, create_jwt_token
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def test_is_logged_in_with_no_token(temp_auth_config: Path) -> None:
|
|
10
|
+
assert not temp_auth_config.exists()
|
|
11
|
+
assert not Identity().is_logged_in()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def test_is_logged_in_with_token(temp_auth_config: Path) -> None:
|
|
15
|
+
write_auth_config(AuthConfig(access_token=USER_TOKEN))
|
|
16
|
+
|
|
17
|
+
assert Identity().is_logged_in()
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def test_is_logged_in_before_token_expires(temp_auth_config: Path) -> None:
|
|
21
|
+
write_auth_config(
|
|
22
|
+
AuthConfig(access_token=USER_TOKEN, expires_at=int(time.time()) + 3600)
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
identity = Identity()
|
|
26
|
+
|
|
27
|
+
assert identity.is_logged_in()
|
|
28
|
+
assert not identity.is_user_token_expired()
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def test_is_logged_in_with_expired_token(temp_auth_config: Path) -> None:
|
|
32
|
+
write_auth_config(
|
|
33
|
+
AuthConfig(access_token=USER_TOKEN, expires_at=int(time.time()) - 3600)
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
identity = Identity()
|
|
37
|
+
|
|
38
|
+
assert not identity.is_logged_in()
|
|
39
|
+
assert identity.is_user_token_expired()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def test_token_without_saved_expiry_is_left_to_the_server(
|
|
43
|
+
temp_auth_config: Path,
|
|
44
|
+
) -> None:
|
|
45
|
+
past_exp = int(time.time()) - 3600
|
|
46
|
+
token = create_jwt_token({"exp": past_exp, "sub": "test_user"})
|
|
47
|
+
|
|
48
|
+
write_auth_config(AuthConfig(access_token=token))
|
|
49
|
+
|
|
50
|
+
identity = Identity()
|
|
51
|
+
|
|
52
|
+
assert identity.is_logged_in()
|
|
53
|
+
assert not identity.is_user_token_expired()
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def test_is_logged_in_with_empty_token(temp_auth_config: Path) -> None:
|
|
57
|
+
write_auth_config(AuthConfig(access_token=""))
|
|
58
|
+
|
|
59
|
+
assert not Identity().is_logged_in()
|
|
@@ -29,11 +29,11 @@ from fastapi_cloud_cli.config import Settings
|
|
|
29
29
|
from fastapi_cloud_cli.utils.cli import get_rich_toolkit
|
|
30
30
|
from tests.conftest import ConfiguredApp
|
|
31
31
|
from tests.utils import (
|
|
32
|
+
USER_TOKEN,
|
|
32
33
|
Keys,
|
|
33
34
|
SnapshotCliRunner,
|
|
34
35
|
build_logs_response,
|
|
35
36
|
changing_dir,
|
|
36
|
-
create_jwt_token,
|
|
37
37
|
)
|
|
38
38
|
|
|
39
39
|
runner = CliRunner()
|
|
@@ -113,7 +113,8 @@ def test_starts_login_when_not_logged_in(
|
|
|
113
113
|
settings: Settings,
|
|
114
114
|
) -> None:
|
|
115
115
|
respx_mock.post(
|
|
116
|
-
"/login/device/authorization",
|
|
116
|
+
"/login/device/authorization",
|
|
117
|
+
data={"client_id": settings.client_id},
|
|
117
118
|
).mock(
|
|
118
119
|
return_value=Response(
|
|
119
120
|
200,
|
|
@@ -177,8 +178,7 @@ def test_cancels_deploy_when_user_declines_login(
|
|
|
177
178
|
def test_shows_login_prompt_when_token_is_expired(
|
|
178
179
|
temp_auth_config: Path, tmp_path: Path
|
|
179
180
|
) -> None:
|
|
180
|
-
|
|
181
|
-
temp_auth_config.write_text(f'{{"access_token": "{expired_token}"}}')
|
|
181
|
+
temp_auth_config.write_text(f'{{"access_token": "{USER_TOKEN}", "expires_at": 0}}')
|
|
182
182
|
|
|
183
183
|
with (
|
|
184
184
|
changing_dir(tmp_path),
|
|
@@ -277,6 +277,22 @@ def test_deploy_json_returns_missing_required_input_without_app_context(
|
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
|
|
280
|
+
def test_deploy_json_returns_session_expired(
|
|
281
|
+
logged_in_with_expired_token: None, tmp_path: Path
|
|
282
|
+
) -> None:
|
|
283
|
+
with changing_dir(tmp_path):
|
|
284
|
+
result = runner.invoke(app, ["deploy", "--json"])
|
|
285
|
+
|
|
286
|
+
assert result.exit_code == 1
|
|
287
|
+
assert json.loads(result.stdout) == {
|
|
288
|
+
"error": {
|
|
289
|
+
"code": "not_logged_in",
|
|
290
|
+
"message": "Your session has expired.",
|
|
291
|
+
"hint": "Run `fastapi cloud login` or set FASTAPI_CLOUD_TOKEN.",
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
|
|
280
296
|
def test_deploy_json_returns_not_logged_in_without_prompt(
|
|
281
297
|
logged_out_cli: None, tmp_path: Path
|
|
282
298
|
) -> None:
|
|
@@ -29,6 +29,22 @@ def test_link_json_requires_app_id(logged_in_cli: None) -> None:
|
|
|
29
29
|
assert result.stderr == ""
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
def test_link_json_returns_session_expired(
|
|
33
|
+
logged_in_with_expired_token: None,
|
|
34
|
+
) -> None:
|
|
35
|
+
result = runner.invoke(app, ["link", "--json"])
|
|
36
|
+
|
|
37
|
+
assert result.exit_code == 1
|
|
38
|
+
assert json.loads(result.stdout) == {
|
|
39
|
+
"error": {
|
|
40
|
+
"code": "not_logged_in",
|
|
41
|
+
"message": "Your session has expired.",
|
|
42
|
+
"hint": "Run `fastapi cloud login`.",
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
assert result.stderr == ""
|
|
46
|
+
|
|
47
|
+
|
|
32
48
|
def test_link_json_returns_not_logged_in_when_logged_out(logged_out_cli: None) -> None:
|
|
33
49
|
result = runner.invoke(app, ["link", "--json"])
|
|
34
50
|
|