fp-cloud-cli 0.0.1b1__py3-none-any.whl
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.
- fp_cli/__init__.py +10 -0
- fp_cli/__main__.py +4 -0
- fp_cli/_click_compat.py +64 -0
- fp_cli/_context.py +332 -0
- fp_cli/_version.py +1 -0
- fp_cli/analytics.py +432 -0
- fp_cli/analytics_config.py +77 -0
- fp_cli/analytics_registry.py +83 -0
- fp_cli/app.py +492 -0
- fp_cli/auth.py +160 -0
- fp_cli/client.py +1694 -0
- fp_cli/commands/__init__.py +0 -0
- fp_cli/commands/_write.py +214 -0
- fp_cli/commands/agent_cmds.py +407 -0
- fp_cli/commands/alerts_cmds.py +445 -0
- fp_cli/commands/audits_cmds.py +1054 -0
- fp_cli/commands/auth_cmds.py +512 -0
- fp_cli/commands/errors_cmds.py +190 -0
- fp_cli/commands/evals_cmds.py +161 -0
- fp_cli/commands/events_cmds.py +159 -0
- fp_cli/commands/fleet_cmds.py +416 -0
- fp_cli/commands/guardrails_cmds.py +148 -0
- fp_cli/commands/incidents_cmds.py +472 -0
- fp_cli/commands/keys_cmds.py +407 -0
- fp_cli/commands/list_cmds.py +63 -0
- fp_cli/commands/orgs_cmds.py +319 -0
- fp_cli/commands/policies_cmds.py +499 -0
- fp_cli/commands/queries_cmds.py +378 -0
- fp_cli/commands/sessions_cmds.py +151 -0
- fp_cli/commands/settings_cmds.py +150 -0
- fp_cli/commands/usage_cmds.py +35 -0
- fp_cli/commands/users_cmds.py +404 -0
- fp_cli/config.py +330 -0
- fp_cli/dates.py +78 -0
- fp_cli/enforcement.py +345 -0
- fp_cli/errors.py +98 -0
- fp_cli/models.py +891 -0
- fp_cli/orgs.py +30 -0
- fp_cli/output.py +6593 -0
- fp_cli/permissions.py +208 -0
- fp_cli/policy_check.py +290 -0
- fp_cli/py.typed +0 -0
- fp_cli/select.py +322 -0
- fp_cli/theme.py +53 -0
- fp_cloud_cli-0.0.1b1.dist-info/METADATA +335 -0
- fp_cloud_cli-0.0.1b1.dist-info/RECORD +50 -0
- fp_cloud_cli-0.0.1b1.dist-info/WHEEL +5 -0
- fp_cloud_cli-0.0.1b1.dist-info/entry_points.txt +2 -0
- fp_cloud_cli-0.0.1b1.dist-info/licenses/LICENSE +42 -0
- fp_cloud_cli-0.0.1b1.dist-info/top_level.txt +1 -0
fp_cli/orgs.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Org-slug helpers (multi-tenant).
|
|
2
|
+
|
|
3
|
+
The dashboard is path-routed by an org slug and validates it against a strict
|
|
4
|
+
pattern (see ``dashboard/lib/org.ts``). The CLI validates the same shape before
|
|
5
|
+
sending an ``X-AgentEye-Org`` header so a typo fails fast with a clear message
|
|
6
|
+
instead of a confusing server error.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import re
|
|
12
|
+
|
|
13
|
+
# lowercase alphanumeric + single hyphens, 1-40 chars (mirrors dashboard SLUG_RE
|
|
14
|
+
# and the server's orgs.slug CHECK constraint). Keep all three in sync.
|
|
15
|
+
_SLUG_RE = re.compile(r"^[a-z0-9]+(?:-[a-z0-9]+)*$")
|
|
16
|
+
|
|
17
|
+
# Reserved first path segments that can never be an org slug (dashboard/lib/org.ts).
|
|
18
|
+
RESERVED_ORG_SLUGS = frozenset(
|
|
19
|
+
{"api", "login", "admin", "ingest", "_next", "favicon.ico", "auth"}
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def is_valid_org_slug(slug: object) -> bool:
|
|
24
|
+
if not isinstance(slug, str) or not slug:
|
|
25
|
+
return False
|
|
26
|
+
if len(slug) > 40:
|
|
27
|
+
return False
|
|
28
|
+
if slug in RESERVED_ORG_SLUGS:
|
|
29
|
+
return False
|
|
30
|
+
return bool(_SLUG_RE.match(slug))
|