pltr-cli 0.13.0__tar.gz → 0.14.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.
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/PKG-INFO +1 -1
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/pyproject.toml +1 -1
- pltr_cli-0.14.0/src/pltr/__init__.py +1 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/auth/oauth.py +10 -1
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/auth/token.py +10 -1
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/cli.py +18 -0
- pltr_cli-0.14.0/src/pltr/commands/audit.py +186 -0
- pltr_cli-0.14.0/src/pltr/commands/data_health.py +474 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/dataset.py +4 -2
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/folder.py +10 -10
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/project.py +12 -12
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/resource.py +18 -18
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/resource_role.py +8 -8
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/space.py +8 -8
- pltr_cli-0.14.0/src/pltr/commands/widgets.py +466 -0
- pltr_cli-0.14.0/src/pltr/services/audit.py +105 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/connectivity.py +121 -3
- pltr_cli-0.14.0/src/pltr/services/data_health.py +212 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/folder.py +25 -4
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/ontology.py +7 -7
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/orchestration.py +25 -4
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/project.py +61 -16
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/resource.py +151 -47
- pltr_cli-0.14.0/src/pltr/services/widgets.py +293 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_auth/test_oauth.py +100 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_auth/test_token.py +88 -0
- pltr_cli-0.14.0/tests/test_commands/test_audit.py +340 -0
- pltr_cli-0.14.0/tests/test_commands/test_data_health.py +396 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_dataset.py +35 -7
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_folder.py +59 -14
- pltr_cli-0.14.0/tests/test_commands/test_widgets.py +560 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_connectivity.py +155 -0
- pltr_cli-0.14.0/tests/test_services/test_data_health.py +259 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_folder.py +39 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_ontology.py +6 -6
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_orchestration.py +96 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_project.py +86 -8
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_resource.py +214 -30
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/uv.lock +1 -1
- pltr_cli-0.13.0/src/pltr/__init__.py +0 -1
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/.github/workflows/ci.yml +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/.github/workflows/claude-code-review.yml +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/.github/workflows/claude.yml +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/.github/workflows/publish.yml +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/.github/workflows/test-publish.yml +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/.gitignore +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/.pre-commit-config.yaml +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/CHANGELOG.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/CLAUDE.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/LICENSE +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/README.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/RELEASE.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/README.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/SKILL.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/admin-commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/aip-agents-commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/connectivity-commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/dataset-commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/filesystem-commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/functions-commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/language-models-commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/mediasets-commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/models-commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/ontology-commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/orchestration-commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/quick-start.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/sql-commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/reference/streams-commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/workflows/data-analysis.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/workflows/data-pipeline.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/claude_skill/workflows/permission-management.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/README.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/api/wrapper.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/examples/csv-upload.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/examples/gallery.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/features/dataset-transactions.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/migration/v2-pagination.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/pagination.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/user-guide/aliases.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/user-guide/authentication.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/user-guide/claude-skill.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/user-guide/commands.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/user-guide/quick-start.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/user-guide/troubleshooting.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/docs/user-guide/workflows.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/mypy.ini +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/scripts/release.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/__main__.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/auth/__init__.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/auth/base.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/auth/manager.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/auth/storage.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/__init__.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/admin.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/aip_agents.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/alias.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/completion.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/configure.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/connectivity.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/cp.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/functions.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/language_models.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/mediasets.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/models.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/ontology.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/orchestration.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/shell.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/sql.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/streams.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/third_party_applications.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/commands/verify.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/config/__init__.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/config/aliases.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/config/profiles.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/config/settings.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/__init__.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/admin.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/aip_agents.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/base.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/copy.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/dataset.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/functions.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/language_models.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/mediasets.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/models.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/resource_role.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/space.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/sql.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/streams.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/services/third_party_applications.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/utils/__init__.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/utils/alias_resolver.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/utils/completion.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/utils/formatting.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/utils/pagination.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/src/pltr/utils/progress.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/__init__.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/conftest.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/integration/README.md +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/integration/__init__.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/integration/conftest.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/integration/test_auth_flow.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/integration/test_cli_integration.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/integration/test_data_workflows.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/integration/test_data_workflows_simple.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/integration/test_simple_integration.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_auth/__init__.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_auth/test_base.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_auth/test_manager.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_auth/test_storage.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/__init__.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_admin.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_aip_agents.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_alias.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_completion.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_connectivity.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_functions.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_language_models.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_mediasets.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_models.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_ontology.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_orchestration.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_shell.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_sql.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_streams.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_third_party_applications.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_commands/test_verify_simple.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_config/__init__.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_config/test_aliases.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_config/test_profiles.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_config/test_settings.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/__init__.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_admin.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_aip_agents.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_base.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_copy.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_dataset.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_dataset_transactions.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_functions.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_language_models.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_mediasets.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_models.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_pagination_integration.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_resource_role.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_space.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_sql.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_services/test_streams.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_utils/__init__.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_utils/test_alias_resolver.py +0 -0
- {pltr_cli-0.13.0 → pltr_cli-0.14.0}/tests/test_utils/test_pagination.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.14.0"
|
|
@@ -54,7 +54,16 @@ class OAuthClientProvider(AuthProvider):
|
|
|
54
54
|
client_secret=self.client_secret, # type: ignore
|
|
55
55
|
scopes=self.scopes,
|
|
56
56
|
)
|
|
57
|
-
|
|
57
|
+
# Newer SDKs may support client-level preview mode while older ones do not.
|
|
58
|
+
# Try the preview-aware constructor first, then fall back for compatibility.
|
|
59
|
+
try:
|
|
60
|
+
return FoundryClient( # type: ignore[call-arg]
|
|
61
|
+
auth=auth, hostname=self.host, preview=True
|
|
62
|
+
)
|
|
63
|
+
except TypeError as e:
|
|
64
|
+
if "preview" not in str(e):
|
|
65
|
+
raise
|
|
66
|
+
return FoundryClient(auth=auth, hostname=self.host)
|
|
58
67
|
|
|
59
68
|
def validate(self) -> bool:
|
|
60
69
|
"""Validate authentication credentials."""
|
|
@@ -32,7 +32,16 @@ class TokenAuthProvider(AuthProvider):
|
|
|
32
32
|
from foundry_sdk import FoundryClient, UserTokenAuth
|
|
33
33
|
|
|
34
34
|
auth = UserTokenAuth(token=self.token) # type: ignore
|
|
35
|
-
|
|
35
|
+
# Newer SDKs may support client-level preview mode while older ones do not.
|
|
36
|
+
# Try the preview-aware constructor first, then fall back for compatibility.
|
|
37
|
+
try:
|
|
38
|
+
return FoundryClient( # type: ignore[call-arg]
|
|
39
|
+
auth=auth, hostname=self.host, preview=True
|
|
40
|
+
)
|
|
41
|
+
except TypeError as e:
|
|
42
|
+
if "preview" not in str(e):
|
|
43
|
+
raise
|
|
44
|
+
return FoundryClient(auth=auth, hostname=self.host)
|
|
36
45
|
|
|
37
46
|
def validate(self) -> bool:
|
|
38
47
|
"""Validate authentication credentials."""
|
|
@@ -30,6 +30,9 @@ from pltr.commands import (
|
|
|
30
30
|
streams,
|
|
31
31
|
language_models,
|
|
32
32
|
models,
|
|
33
|
+
data_health,
|
|
34
|
+
audit,
|
|
35
|
+
widgets,
|
|
33
36
|
)
|
|
34
37
|
from pltr.commands.cp import cp_command
|
|
35
38
|
|
|
@@ -91,6 +94,21 @@ app.add_typer(
|
|
|
91
94
|
name="models",
|
|
92
95
|
help="Manage ML models and versions",
|
|
93
96
|
)
|
|
97
|
+
app.add_typer(
|
|
98
|
+
data_health.app,
|
|
99
|
+
name="data-health",
|
|
100
|
+
help="Manage data health checks and reports",
|
|
101
|
+
)
|
|
102
|
+
app.add_typer(
|
|
103
|
+
audit.app,
|
|
104
|
+
name="audit",
|
|
105
|
+
help="Audit log operations for compliance and security monitoring",
|
|
106
|
+
)
|
|
107
|
+
app.add_typer(
|
|
108
|
+
widgets.app,
|
|
109
|
+
name="widgets",
|
|
110
|
+
help="Manage widget sets, releases, and repositories",
|
|
111
|
+
)
|
|
94
112
|
app.add_typer(
|
|
95
113
|
admin.app,
|
|
96
114
|
name="admin",
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Audit log file management commands for Foundry.
|
|
3
|
+
Provides access to audit logs for compliance and security monitoring.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from datetime import date, datetime
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Optional
|
|
9
|
+
|
|
10
|
+
import typer
|
|
11
|
+
from rich.console import Console
|
|
12
|
+
|
|
13
|
+
from ..auth.base import MissingCredentialsError, ProfileNotFoundError
|
|
14
|
+
from ..services.audit import AuditService
|
|
15
|
+
from ..utils.completion import (
|
|
16
|
+
complete_output_format,
|
|
17
|
+
complete_profile,
|
|
18
|
+
complete_rid,
|
|
19
|
+
cache_rid,
|
|
20
|
+
)
|
|
21
|
+
from ..utils.formatting import OutputFormatter
|
|
22
|
+
from ..utils.progress import SpinnerProgressTracker
|
|
23
|
+
|
|
24
|
+
app = typer.Typer(help="Audit log operations for compliance and security monitoring")
|
|
25
|
+
console = Console()
|
|
26
|
+
formatter = OutputFormatter(console)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def parse_date(date_str: str) -> date:
|
|
30
|
+
"""Parse a date string in YYYY-MM-DD format (not full ISO 8601)."""
|
|
31
|
+
try:
|
|
32
|
+
return datetime.strptime(date_str, "%Y-%m-%d").date()
|
|
33
|
+
except ValueError:
|
|
34
|
+
raise typer.BadParameter(f"Invalid date format: {date_str}. Use YYYY-MM-DD.")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@app.command("list")
|
|
38
|
+
def list_log_files(
|
|
39
|
+
organization_rid: str = typer.Argument(
|
|
40
|
+
...,
|
|
41
|
+
help="Organization Resource Identifier (e.g., ri.multipass..organization.xxx)",
|
|
42
|
+
autocompletion=complete_rid,
|
|
43
|
+
),
|
|
44
|
+
start_date: str = typer.Argument(
|
|
45
|
+
...,
|
|
46
|
+
help="Start date for audit events (YYYY-MM-DD format, required)",
|
|
47
|
+
),
|
|
48
|
+
end_date: Optional[str] = typer.Option(
|
|
49
|
+
None,
|
|
50
|
+
"--end-date",
|
|
51
|
+
"-e",
|
|
52
|
+
help="End date for audit events (YYYY-MM-DD format, inclusive)",
|
|
53
|
+
),
|
|
54
|
+
page_size: Optional[int] = typer.Option(
|
|
55
|
+
None,
|
|
56
|
+
"--page-size",
|
|
57
|
+
help="Number of results per page",
|
|
58
|
+
),
|
|
59
|
+
profile: Optional[str] = typer.Option(
|
|
60
|
+
None,
|
|
61
|
+
"--profile",
|
|
62
|
+
"-p",
|
|
63
|
+
help="Profile name",
|
|
64
|
+
autocompletion=complete_profile,
|
|
65
|
+
),
|
|
66
|
+
format: str = typer.Option(
|
|
67
|
+
"table",
|
|
68
|
+
"--format",
|
|
69
|
+
"-f",
|
|
70
|
+
help="Output format (table, json, csv)",
|
|
71
|
+
autocompletion=complete_output_format,
|
|
72
|
+
),
|
|
73
|
+
output: Optional[str] = typer.Option(
|
|
74
|
+
None, "--output", "-o", help="Output file path"
|
|
75
|
+
),
|
|
76
|
+
) -> None:
|
|
77
|
+
"""List audit log files for an organization."""
|
|
78
|
+
try:
|
|
79
|
+
# Cache the RID for future completions
|
|
80
|
+
cache_rid(organization_rid)
|
|
81
|
+
|
|
82
|
+
# Parse dates
|
|
83
|
+
start = parse_date(start_date)
|
|
84
|
+
end = parse_date(end_date) if end_date else None
|
|
85
|
+
|
|
86
|
+
service = AuditService(profile=profile)
|
|
87
|
+
|
|
88
|
+
with SpinnerProgressTracker().track_spinner("Fetching audit log files..."):
|
|
89
|
+
logs = service.list_log_files(
|
|
90
|
+
organization_rid=organization_rid,
|
|
91
|
+
start_date=start,
|
|
92
|
+
end_date=end,
|
|
93
|
+
page_size=page_size,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
if not logs:
|
|
97
|
+
formatter.print_info("No audit log files found for the specified criteria")
|
|
98
|
+
return
|
|
99
|
+
|
|
100
|
+
formatter.print_info(f"Found {len(logs)} audit log files")
|
|
101
|
+
|
|
102
|
+
if output:
|
|
103
|
+
formatter.save_to_file(logs, output, format)
|
|
104
|
+
formatter.print_success(f"Audit log files saved to {output}")
|
|
105
|
+
else:
|
|
106
|
+
formatter.display(logs, format)
|
|
107
|
+
|
|
108
|
+
except (ProfileNotFoundError, MissingCredentialsError) as e:
|
|
109
|
+
formatter.print_error(f"Authentication error: {e}")
|
|
110
|
+
raise typer.Exit(1)
|
|
111
|
+
except typer.BadParameter:
|
|
112
|
+
raise
|
|
113
|
+
except ValueError as e:
|
|
114
|
+
formatter.print_error(f"Invalid request: {e}")
|
|
115
|
+
raise typer.Exit(1)
|
|
116
|
+
except Exception as e:
|
|
117
|
+
formatter.print_error(f"Failed to list audit log files: {e}")
|
|
118
|
+
raise typer.Exit(1)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
@app.command("get")
|
|
122
|
+
def get_log_file_content(
|
|
123
|
+
organization_rid: str = typer.Argument(
|
|
124
|
+
...,
|
|
125
|
+
help="Organization Resource Identifier (e.g., ri.multipass..organization.xxx)",
|
|
126
|
+
autocompletion=complete_rid,
|
|
127
|
+
),
|
|
128
|
+
log_file_id: str = typer.Argument(
|
|
129
|
+
...,
|
|
130
|
+
help="Log file identifier (from list command)",
|
|
131
|
+
),
|
|
132
|
+
output: Optional[str] = typer.Option(
|
|
133
|
+
None,
|
|
134
|
+
"--output",
|
|
135
|
+
"-o",
|
|
136
|
+
help="Output file path (required for binary content)",
|
|
137
|
+
),
|
|
138
|
+
profile: Optional[str] = typer.Option(
|
|
139
|
+
None,
|
|
140
|
+
"--profile",
|
|
141
|
+
"-p",
|
|
142
|
+
help="Profile name",
|
|
143
|
+
autocompletion=complete_profile,
|
|
144
|
+
),
|
|
145
|
+
) -> None:
|
|
146
|
+
"""Get the content of a specific audit log file."""
|
|
147
|
+
try:
|
|
148
|
+
# Cache the RID for future completions
|
|
149
|
+
cache_rid(organization_rid)
|
|
150
|
+
|
|
151
|
+
service = AuditService(profile=profile)
|
|
152
|
+
|
|
153
|
+
with SpinnerProgressTracker().track_spinner(
|
|
154
|
+
f"Fetching audit log file {log_file_id}..."
|
|
155
|
+
):
|
|
156
|
+
content = service.get_log_file_content(
|
|
157
|
+
organization_rid=organization_rid,
|
|
158
|
+
log_file_id=log_file_id,
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
if output:
|
|
162
|
+
# Write binary content to file
|
|
163
|
+
Path(output).write_bytes(content)
|
|
164
|
+
formatter.print_success(
|
|
165
|
+
f"Audit log file saved to {output} ({len(content)} bytes)"
|
|
166
|
+
)
|
|
167
|
+
else:
|
|
168
|
+
# Try to decode as text for display
|
|
169
|
+
try:
|
|
170
|
+
text_content = content.decode("utf-8")
|
|
171
|
+
console.print(text_content)
|
|
172
|
+
except UnicodeDecodeError:
|
|
173
|
+
formatter.print_error(
|
|
174
|
+
"Log file contains binary content. Use --output to save to a file."
|
|
175
|
+
)
|
|
176
|
+
raise typer.Exit(1)
|
|
177
|
+
|
|
178
|
+
except (ProfileNotFoundError, MissingCredentialsError) as e:
|
|
179
|
+
formatter.print_error(f"Authentication error: {e}")
|
|
180
|
+
raise typer.Exit(1)
|
|
181
|
+
except ValueError as e:
|
|
182
|
+
formatter.print_error(f"Invalid request: {e}")
|
|
183
|
+
raise typer.Exit(1)
|
|
184
|
+
except Exception as e:
|
|
185
|
+
formatter.print_error(f"Failed to get audit log file: {e}")
|
|
186
|
+
raise typer.Exit(1)
|