proxy-platform 0.3.5__tar.gz → 0.3.7__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.
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/PKG-INFO +1 -1
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/__init__.py +1 -1
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/main_public.py +22 -9
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform.egg-info/PKG-INFO +1 -1
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/pyproject.toml +1 -1
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/README.md +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/README.public.md +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/client.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/commands/__init__.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/commands/auth.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/commands/clusters.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/commands/deployments.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/commands/feedback.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/commands/firewalls.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/commands/orders.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/commands/products.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/commands/support.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/commands/users.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/config.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform/main.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform.egg-info/SOURCES.txt +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform.egg-info/dependency_links.txt +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform.egg-info/entry_points.txt +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform.egg-info/requires.txt +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/proxy_platform.egg-info/top_level.txt +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/setup.cfg +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/setup.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/tests/test_admin_feedback.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/tests/test_auth.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/tests/test_client.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/tests/test_clusters.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/tests/test_config.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/tests/test_deployments.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/tests/test_dev.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/tests/test_feedback.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/tests/test_firewalls.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/tests/test_main.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/tests/test_orders.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/tests/test_products.py +0 -0
- {proxy_platform-0.3.5 → proxy_platform-0.3.7}/tests/test_users.py +0 -0
|
@@ -6,13 +6,29 @@ import typer
|
|
|
6
6
|
from rich.console import Console
|
|
7
7
|
from rich.logging import RichHandler
|
|
8
8
|
|
|
9
|
-
from . import __version__, config
|
|
9
|
+
from . import __version__, client, config
|
|
10
10
|
|
|
11
11
|
config.get_current_environment = lambda: "production"
|
|
12
12
|
config.get_default_api_type = lambda: "user"
|
|
13
13
|
|
|
14
|
+
# Force every APIClient instance to user-API regardless of what --api was passed.
|
|
15
|
+
# The shared commands accept --api admin|user; for the public CLI admin doesn't exist.
|
|
16
|
+
_orig_apiclient_init = client.APIClient.__init__
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _public_apiclient_init(self, api_type=None): # type: ignore[no-untyped-def]
|
|
20
|
+
_orig_apiclient_init(self, api_type="user")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
client.APIClient.__init__ = _public_apiclient_init # type: ignore[method-assign]
|
|
24
|
+
|
|
14
25
|
from .commands import auth, clusters, feedback, firewalls, orders, products, support, users # noqa: E402
|
|
15
26
|
|
|
27
|
+
# Strip admin/internal-only sub-commands from shared Typer apps for the public CLI.
|
|
28
|
+
auth.app.registered_commands = [
|
|
29
|
+
c for c in auth.app.registered_commands if (c.callback.__name__ if c.callback else c.name) != "switch"
|
|
30
|
+
]
|
|
31
|
+
|
|
16
32
|
app = typer.Typer(
|
|
17
33
|
name="proxy-platform",
|
|
18
34
|
help="Proxy Platform CLI",
|
|
@@ -75,30 +91,27 @@ def version() -> None:
|
|
|
75
91
|
def login_alias(
|
|
76
92
|
email: str | None = typer.Option(None, "--email", "-e", help="Email address"),
|
|
77
93
|
password: str | None = typer.Option(None, "--password", "-p", help="Password"),
|
|
78
|
-
api: str = typer.Option("user", "--api", "-a", help="API type"),
|
|
79
94
|
) -> None:
|
|
80
|
-
"""Login
|
|
95
|
+
"""Login (alias for 'auth login')."""
|
|
81
96
|
from .commands.auth import login as auth_login
|
|
82
97
|
|
|
83
|
-
auth_login(email=email, password=password, api=
|
|
98
|
+
auth_login(email=email, password=password, api="user")
|
|
84
99
|
|
|
85
100
|
|
|
86
101
|
@app.command(name="logout")
|
|
87
102
|
def logout_alias() -> None:
|
|
88
|
-
"""Logout
|
|
103
|
+
"""Logout (alias for 'auth logout')."""
|
|
89
104
|
from .commands.auth import logout as auth_logout
|
|
90
105
|
|
|
91
106
|
auth_logout()
|
|
92
107
|
|
|
93
108
|
|
|
94
109
|
@app.command(name="whoami")
|
|
95
|
-
def whoami_alias(
|
|
96
|
-
api: str | None = typer.Option(None, "--api", "-a", help="API type"),
|
|
97
|
-
) -> None:
|
|
110
|
+
def whoami_alias() -> None:
|
|
98
111
|
"""Show current user info (alias for 'auth whoami')."""
|
|
99
112
|
from .commands.auth import whoami as auth_whoami
|
|
100
113
|
|
|
101
|
-
auth_whoami(api=
|
|
114
|
+
auth_whoami(api="user")
|
|
102
115
|
|
|
103
116
|
|
|
104
117
|
if __name__ == "__main__":
|
|
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
|
|
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
|