pal-found-cli 0.1.4__tar.gz → 0.1.5__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.
- pal_found_cli-0.1.5/.safety-policy.yml +20 -0
- pal_found_cli-0.1.5/CHANGELOG.md +17 -0
- {pal_found_cli-0.1.4/src/pal_found_cli.egg-info → pal_found_cli-0.1.5}/PKG-INFO +1 -1
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/_version.py +3 -3
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/admin/scripts/pal_found_admin_cli.py +39 -25
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/pagination_helper.py +19 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/filesystem/scripts/pal_found_filesystem_cli.py +20 -21
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/functions/scripts/pal_found_functions_cli.py +2 -2
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/ontologies/scripts/pal_found_ontologies_cli.py +134 -13
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5/src/pal_found_cli.egg-info}/PKG-INFO +1 -1
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli.egg-info/SOURCES.txt +3 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli.egg-info/scm_file_list.json +3 -0
- pal_found_cli-0.1.5/src/pal_found_cli.egg-info/scm_version.json +8 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pagination_helper.py +49 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_admin_cli.py +167 -15
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_filesystem_cli.py +126 -15
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_functions_cli.py +3 -3
- pal_found_cli-0.1.5/tests/test_pal_found_ontologies_cli.py +493 -0
- pal_found_cli-0.1.4/src/pal_found_cli.egg-info/scm_version.json +0 -8
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/.env.example +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/.github/workflows/ci.yml +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/.github/workflows/publish.yml +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/.gitignore +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/LICENSE +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/README.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/conda.recipe/meta.yaml +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/pyproject.toml +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/setup.cfg +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/admin/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/admin/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/aip_agents/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/aip_agents/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/aip_agents/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/aip_agents/scripts/pal_found_aip_agents_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/audit/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/audit/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/audit/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/audit/scripts/pal_found_audit_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/checkpoints/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/checkpoints/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/checkpoints/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/checkpoints/scripts/pal_found_checkpoints_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/access_control_guard.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/async_client_factory.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/auth_provider.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/binary_download_handler.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/config_loader.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/error_serializer.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/log_setup.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/output_formatter.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/retry.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/sdk_error_utils.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/session_manager.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/common/tracing_provider.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/connectivity/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/connectivity/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/connectivity/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/connectivity/scripts/pal_found_connectivity_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/data_health/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/data_health/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/data_health/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/data_health/scripts/pal_found_data_health_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/datasets/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/datasets/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/datasets/scripts/pal_found_datasets_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/filesystem/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/filesystem/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/functions/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/functions/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/language_models/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/language_models/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/language_models/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/language_models/scripts/pal_found_language_models_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/media_sets/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/media_sets/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/media_sets/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/media_sets/scripts/pal_found_media_sets_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/models/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/models/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/models/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/models/scripts/pal_found_models_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/ontologies/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/ontologies/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/orchestration/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/orchestration/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/orchestration/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/orchestration/scripts/pal_found_orchestration_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/sql_queries/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/sql_queries/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/sql_queries/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/sql_queries/scripts/pal_found_sql_queries_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/streams/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/streams/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/streams/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/streams/scripts/pal_found_streams_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/third_party_applications/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/third_party_applications/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/third_party_applications/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/third_party_applications/scripts/pal_found_third_party_applications_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/widgets/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/widgets/metadata-allow-list.md +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/widgets/scripts/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/widgets/scripts/pal_found_widgets_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli.egg-info/dependency_links.txt +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli.egg-info/entry_points.txt +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli.egg-info/requires.txt +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli.egg-info/top_level.txt +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/__init__.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_access_control_guard.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_admin_console_wrapper.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_aip_agents_console_wrapper.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_audit_console_wrapper.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_binary_download.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_checkpoints_console_wrapper.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_data_health_console_wrapper.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_datasets_console_wrapper.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_exec_common_components.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_exec_retry_error_output_log.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_filesystem_console_wrapper.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_functions_console_wrapper.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_language_models_console_wrapper.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_ontologies_console_wrapper.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_aip_agents_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_audit_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_checkpoints_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_connectivity_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_data_health_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_language_models_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_media_sets_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_models_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_orchestration_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_sql_queries_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_streams_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_third_party_applications_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_pal_found_widgets_cli.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_release_artifacts.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_rename_migration.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_repository_hygiene.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_session_manager.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_third_party_applications_console_wrapper.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_tracing_provider.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/test_widgets_console_wrapper.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/unit_test_common_components.py +0 -0
- {pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/tests/unit_test_retry_error_output_log.py +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Safety policy for the CI dependency scan (`safety check`).
|
|
2
|
+
#
|
|
3
|
+
# The scan runs against the CI environment, which contains the scanner plus
|
|
4
|
+
# its own dependencies. Every suppression here is reviewed and time-bound.
|
|
5
|
+
security:
|
|
6
|
+
# Keep the scan blocking: a non-suppressed vulnerability still fails CI.
|
|
7
|
+
continue-on-vulnerability-error: False
|
|
8
|
+
ignore-vulnerabilities:
|
|
9
|
+
# nltk is pulled in by the safety scanner (safety 3.8.1 requires
|
|
10
|
+
# nltk>=3.9), not by pal_found_cli itself. No fixed release exists
|
|
11
|
+
# above 3.10.3 on PyPI, so the finding cannot be remediated by an
|
|
12
|
+
# upgrade. Advisory: SFTY-20260902-58666 / CVE-2026-81726 (path
|
|
13
|
+
# traversal). Remove this entry once a fixed nltk release is available
|
|
14
|
+
# or safety drops the nltk dependency.
|
|
15
|
+
SFTY-20260902-58666:
|
|
16
|
+
reason: >-
|
|
17
|
+
Path traversal (CVE-2026-81726) in nltk, which the safety scanner
|
|
18
|
+
pulls transitively. nltk is not a pal_found_cli dependency and no
|
|
19
|
+
fixed release exists above 3.10.3. Remove when a fix ships.
|
|
20
|
+
expires: "2027-01-09"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `pal_found_cli` are recorded here.
|
|
4
|
+
|
|
5
|
+
## [0.1.5] - 2026-10-14
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Corrected Admin and Filesystem pagination and error handling.
|
|
10
|
+
- Validated Ontology inputs and clarified paginated response metadata.
|
|
11
|
+
- Corrected Functions attribution parsing and shared pagination behavior.
|
|
12
|
+
|
|
13
|
+
## [0.1.4] - 2026-10-06
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- Added bounded Datasets pagination and related command coverage.
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.1.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 1,
|
|
21
|
+
__version__ = version = '0.1.5'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 1, 5)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'gb9c5f8a1a'
|
{pal_found_cli-0.1.4 → pal_found_cli-0.1.5}/src/pal_found_cli/admin/scripts/pal_found_admin_cli.py
RENAMED
|
@@ -8,7 +8,6 @@ import asyncio
|
|
|
8
8
|
import inspect
|
|
9
9
|
import json
|
|
10
10
|
import logging
|
|
11
|
-
import math
|
|
12
11
|
import sys
|
|
13
12
|
from collections.abc import Iterable
|
|
14
13
|
from pathlib import Path
|
|
@@ -39,8 +38,6 @@ from pal_found_cli.common.error_serializer import ( # noqa: E402
|
|
|
39
38
|
EXIT_ACCESS_CONTROL,
|
|
40
39
|
EXIT_NOT_FOUND,
|
|
41
40
|
EXIT_PERMISSION_DENIED,
|
|
42
|
-
EXIT_RATE_LIMIT,
|
|
43
|
-
EXIT_SERVER_ERROR,
|
|
44
41
|
EXIT_SUCCESS,
|
|
45
42
|
EXIT_TIMEOUT,
|
|
46
43
|
EXIT_USER_INPUT,
|
|
@@ -48,7 +45,7 @@ from pal_found_cli.common.error_serializer import ( # noqa: E402
|
|
|
48
45
|
)
|
|
49
46
|
from pal_found_cli.common.log_setup import LogSetup # noqa: E402
|
|
50
47
|
from pal_found_cli.common.output_formatter import OutputFormatter # noqa: E402
|
|
51
|
-
from pal_found_cli.common.pagination_helper import PaginationHelper # noqa: E402
|
|
48
|
+
from pal_found_cli.common.pagination_helper import PaginationBoundaryError, PaginationHelper # noqa: E402
|
|
52
49
|
from pal_found_cli.common.retry import RetryHandler # noqa: E402
|
|
53
50
|
|
|
54
51
|
logger = logging.getLogger(__name__)
|
|
@@ -401,18 +398,25 @@ async def _read_next_page_token(iterator: Any) -> str | None:
|
|
|
401
398
|
|
|
402
399
|
|
|
403
400
|
async def _collect_async_iterator(iterator: Any, helper: PaginationHelper) -> list[Any]:
|
|
404
|
-
"""Collect
|
|
405
|
-
|
|
406
|
-
|
|
401
|
+
"""Collect complete SDK pages so a continuation never skips page items."""
|
|
402
|
+
page_iterator = getattr(iterator, "_page_iterator", None)
|
|
403
|
+
if page_iterator is None or not hasattr(page_iterator, "__anext__"):
|
|
404
|
+
raise PaginationBoundaryError("SDK async iterator does not expose page boundaries")
|
|
407
405
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
406
|
+
items: list[Any] = []
|
|
407
|
+
token: str | None = None
|
|
408
|
+
for _ in range(helper.batch_pages):
|
|
409
|
+
try:
|
|
410
|
+
page = await page_iterator.__anext__()
|
|
411
|
+
except StopAsyncIteration:
|
|
412
|
+
break
|
|
413
|
+
items.extend(page)
|
|
414
|
+
helper._pages_fetched += 1
|
|
415
|
+
token = await _read_next_page_token(iterator)
|
|
416
|
+
if token is None:
|
|
411
417
|
break
|
|
412
|
-
|
|
413
418
|
helper._total_items += len(items)
|
|
414
|
-
helper.
|
|
415
|
-
helper._next_page_token = await _read_next_page_token(iterator)
|
|
419
|
+
helper._next_page_token = token
|
|
416
420
|
return items
|
|
417
421
|
|
|
418
422
|
|
|
@@ -420,16 +424,26 @@ async def _paginate_page_envelopes(
|
|
|
420
424
|
first_response: Any,
|
|
421
425
|
call_func: Any,
|
|
422
426
|
helper: PaginationHelper,
|
|
427
|
+
*,
|
|
428
|
+
search_response: bool = False,
|
|
423
429
|
) -> list[Any]:
|
|
424
|
-
"""Collect
|
|
425
|
-
|
|
430
|
+
"""Collect records from Admin page responses."""
|
|
431
|
+
|
|
432
|
+
def page_items(response: Any) -> list[Any]:
|
|
433
|
+
if search_response:
|
|
434
|
+
data = response.get("data") if isinstance(response, dict) else getattr(response, "data", None)
|
|
435
|
+
if isinstance(data, list):
|
|
436
|
+
return data
|
|
437
|
+
return helper._extract_items(response)
|
|
438
|
+
|
|
439
|
+
all_items = page_items(first_response)
|
|
426
440
|
helper._total_items += len(all_items)
|
|
427
441
|
helper._pages_fetched += 1
|
|
428
442
|
token = helper._extract_next_token(first_response)
|
|
429
443
|
|
|
430
444
|
while token is not None and helper.pages_fetched < helper.batch_pages:
|
|
431
445
|
response = await call_func(page_size=helper.page_size, page_token=token)
|
|
432
|
-
items =
|
|
446
|
+
items = page_items(response)
|
|
433
447
|
all_items.extend(items)
|
|
434
448
|
helper._total_items += len(items)
|
|
435
449
|
helper._pages_fetched += 1
|
|
@@ -478,6 +492,7 @@ async def _invoke_paginated(
|
|
|
478
492
|
helper: PaginationHelper,
|
|
479
493
|
) -> Any:
|
|
480
494
|
"""Invoke a paginated admin operation."""
|
|
495
|
+
helper.reset_progress()
|
|
481
496
|
|
|
482
497
|
async def _single_page(**page_kwargs: Any) -> Any:
|
|
483
498
|
paged_args = argparse.Namespace(**vars(args))
|
|
@@ -490,7 +505,12 @@ async def _invoke_paginated(
|
|
|
490
505
|
first_response = await _single_page(**helper.get_sdk_params())
|
|
491
506
|
if _is_async_iterator(first_response):
|
|
492
507
|
return await _collect_async_iterator(first_response, helper)
|
|
493
|
-
return await _paginate_page_envelopes(
|
|
508
|
+
return await _paginate_page_envelopes(
|
|
509
|
+
first_response,
|
|
510
|
+
_single_page,
|
|
511
|
+
helper,
|
|
512
|
+
search_response=operation == "search" and resource in {"group", "user"},
|
|
513
|
+
)
|
|
494
514
|
|
|
495
515
|
|
|
496
516
|
async def main() -> int:
|
|
@@ -579,15 +599,9 @@ async def main() -> int:
|
|
|
579
599
|
ErrorSerializer().serialize(exc)
|
|
580
600
|
return EXIT_USER_INPUT
|
|
581
601
|
except OSError as exc:
|
|
582
|
-
|
|
583
|
-
if getattr(exc, "errno", None) in (11, 115):
|
|
584
|
-
return EXIT_RATE_LIMIT
|
|
585
|
-
return exit_code
|
|
602
|
+
return ErrorSerializer().serialize(exc)
|
|
586
603
|
except Exception as exc:
|
|
587
|
-
|
|
588
|
-
if exit_code != EXIT_USER_INPUT:
|
|
589
|
-
return exit_code
|
|
590
|
-
return EXIT_SERVER_ERROR
|
|
604
|
+
return ErrorSerializer().serialize(exc)
|
|
591
605
|
|
|
592
606
|
|
|
593
607
|
def console_main() -> int:
|
|
@@ -17,6 +17,7 @@ import os
|
|
|
17
17
|
import sys
|
|
18
18
|
from typing import Any
|
|
19
19
|
|
|
20
|
+
from pal_found_cli.common.error_serializer import EXIT_SERVER_ERROR
|
|
20
21
|
from pal_found_cli.common.log_setup import METADATA_SEPARATOR
|
|
21
22
|
|
|
22
23
|
# Default values (from SRS-001 §5)
|
|
@@ -30,6 +31,12 @@ MAX_BATCH_PAGES = min(
|
|
|
30
31
|
)
|
|
31
32
|
|
|
32
33
|
|
|
34
|
+
class PaginationBoundaryError(RuntimeError):
|
|
35
|
+
"""The SDK iterator does not expose a safe page boundary."""
|
|
36
|
+
|
|
37
|
+
exit_code = EXIT_SERVER_ERROR
|
|
38
|
+
|
|
39
|
+
|
|
33
40
|
class PaginationHelper:
|
|
34
41
|
"""Manages pagination for SDK calls.
|
|
35
42
|
|
|
@@ -68,6 +75,7 @@ class PaginationHelper:
|
|
|
68
75
|
self._next_page_token: str | None = None
|
|
69
76
|
self._total_items: int = 0
|
|
70
77
|
self._pages_fetched: int = 0
|
|
78
|
+
self._response_metadata: list[dict[str, Any]] = []
|
|
71
79
|
|
|
72
80
|
@staticmethod
|
|
73
81
|
def _validate_positive_int(name: str, value: int) -> int:
|
|
@@ -108,6 +116,13 @@ class PaginationHelper:
|
|
|
108
116
|
params["page_token"] = self.page_token
|
|
109
117
|
return params
|
|
110
118
|
|
|
119
|
+
def reset_progress(self) -> None:
|
|
120
|
+
"""Discard counters from a failed batch before a retry."""
|
|
121
|
+
self._next_page_token = None
|
|
122
|
+
self._total_items = 0
|
|
123
|
+
self._pages_fetched = 0
|
|
124
|
+
self._response_metadata.clear()
|
|
125
|
+
|
|
111
126
|
def _extract_items(self, response: Any) -> list[Any]:
|
|
112
127
|
"""Extract items list from SDK response.
|
|
113
128
|
|
|
@@ -185,6 +200,8 @@ class PaginationHelper:
|
|
|
185
200
|
all_items.extend(items)
|
|
186
201
|
self._total_items += len(items)
|
|
187
202
|
self._pages_fetched += 1
|
|
203
|
+
if isinstance(response, dict) and isinstance(response.get("page_metadata"), dict):
|
|
204
|
+
self._response_metadata.append(response["page_metadata"])
|
|
188
205
|
|
|
189
206
|
token = self._extract_next_token(response)
|
|
190
207
|
if token is None:
|
|
@@ -206,6 +223,8 @@ class PaginationHelper:
|
|
|
206
223
|
metadata["next_page_token"] = self._next_page_token
|
|
207
224
|
if self.page_size:
|
|
208
225
|
metadata["page_size"] = self.page_size
|
|
226
|
+
if self._response_metadata:
|
|
227
|
+
metadata["response_metadata"] = self._response_metadata
|
|
209
228
|
|
|
210
229
|
sys.stderr.write(METADATA_SEPARATOR + "\n")
|
|
211
230
|
sys.stderr.write(json.dumps(metadata) + "\n")
|
|
@@ -8,7 +8,6 @@ import asyncio
|
|
|
8
8
|
import inspect
|
|
9
9
|
import json
|
|
10
10
|
import logging
|
|
11
|
-
import math
|
|
12
11
|
import sys
|
|
13
12
|
from collections.abc import Iterable
|
|
14
13
|
from pathlib import Path
|
|
@@ -39,8 +38,6 @@ from pal_found_cli.common.error_serializer import (
|
|
|
39
38
|
EXIT_ACCESS_CONTROL,
|
|
40
39
|
EXIT_NOT_FOUND,
|
|
41
40
|
EXIT_PERMISSION_DENIED,
|
|
42
|
-
EXIT_RATE_LIMIT,
|
|
43
|
-
EXIT_SERVER_ERROR,
|
|
44
41
|
EXIT_SUCCESS,
|
|
45
42
|
EXIT_TIMEOUT,
|
|
46
43
|
EXIT_USER_INPUT,
|
|
@@ -48,7 +45,7 @@ from pal_found_cli.common.error_serializer import (
|
|
|
48
45
|
)
|
|
49
46
|
from pal_found_cli.common.log_setup import LogSetup
|
|
50
47
|
from pal_found_cli.common.output_formatter import OutputFormatter
|
|
51
|
-
from pal_found_cli.common.pagination_helper import PaginationHelper
|
|
48
|
+
from pal_found_cli.common.pagination_helper import PaginationBoundaryError, PaginationHelper
|
|
52
49
|
from pal_found_cli.common.retry import RetryHandler
|
|
53
50
|
|
|
54
51
|
logger = logging.getLogger(__name__)
|
|
@@ -461,18 +458,25 @@ async def _read_next_page_token(iterator: Any) -> str | None:
|
|
|
461
458
|
|
|
462
459
|
|
|
463
460
|
async def _collect_async_iterator(iterator: Any, helper: PaginationHelper) -> list[Any]:
|
|
464
|
-
"""Collect
|
|
465
|
-
|
|
466
|
-
|
|
461
|
+
"""Collect complete SDK pages so a continuation never skips page items."""
|
|
462
|
+
page_iterator = getattr(iterator, "_page_iterator", None)
|
|
463
|
+
if page_iterator is None or not hasattr(page_iterator, "__anext__"):
|
|
464
|
+
raise PaginationBoundaryError("SDK async iterator does not expose page boundaries")
|
|
467
465
|
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
466
|
+
items: list[Any] = []
|
|
467
|
+
token: str | None = None
|
|
468
|
+
for _ in range(helper.batch_pages):
|
|
469
|
+
try:
|
|
470
|
+
page = await page_iterator.__anext__()
|
|
471
|
+
except StopAsyncIteration:
|
|
472
|
+
break
|
|
473
|
+
items.extend(page)
|
|
474
|
+
helper._pages_fetched += 1
|
|
475
|
+
token = await _read_next_page_token(iterator)
|
|
476
|
+
if token is None:
|
|
471
477
|
break
|
|
472
|
-
|
|
473
478
|
helper._total_items += len(items)
|
|
474
|
-
helper.
|
|
475
|
-
helper._next_page_token = await _read_next_page_token(iterator)
|
|
479
|
+
helper._next_page_token = token
|
|
476
480
|
return items
|
|
477
481
|
|
|
478
482
|
|
|
@@ -538,6 +542,7 @@ async def _invoke_paginated(
|
|
|
538
542
|
helper: PaginationHelper,
|
|
539
543
|
) -> Any:
|
|
540
544
|
"""Invoke a paginated filesystem operation."""
|
|
545
|
+
helper.reset_progress()
|
|
541
546
|
|
|
542
547
|
async def _single_page(**page_kwargs: Any) -> Any:
|
|
543
548
|
paged_args = argparse.Namespace(**vars(args))
|
|
@@ -639,15 +644,9 @@ async def main() -> int:
|
|
|
639
644
|
ErrorSerializer().serialize(exc)
|
|
640
645
|
return EXIT_USER_INPUT
|
|
641
646
|
except OSError as exc:
|
|
642
|
-
|
|
643
|
-
if getattr(exc, "errno", None) in (11, 115):
|
|
644
|
-
return EXIT_RATE_LIMIT
|
|
645
|
-
return exit_code
|
|
647
|
+
return ErrorSerializer().serialize(exc)
|
|
646
648
|
except Exception as exc:
|
|
647
|
-
|
|
648
|
-
if exit_code != EXIT_USER_INPUT:
|
|
649
|
-
return exit_code
|
|
650
|
-
return EXIT_SERVER_ERROR
|
|
649
|
+
return ErrorSerializer().serialize(exc)
|
|
651
650
|
|
|
652
651
|
|
|
653
652
|
def console_main() -> int:
|
|
@@ -95,7 +95,7 @@ OP_SPECS: tuple[OperationSpec, ...] = (
|
|
|
95
95
|
"transaction_id",
|
|
96
96
|
"version",
|
|
97
97
|
),
|
|
98
|
-
json_args=("parameters",
|
|
98
|
+
json_args=("parameters",),
|
|
99
99
|
),
|
|
100
100
|
_op(
|
|
101
101
|
"query",
|
|
@@ -139,7 +139,7 @@ OP_SPECS: tuple[OperationSpec, ...] = (
|
|
|
139
139
|
"transaction_id",
|
|
140
140
|
"version",
|
|
141
141
|
),
|
|
142
|
-
json_args=("parameters",
|
|
142
|
+
json_args=("parameters",),
|
|
143
143
|
),
|
|
144
144
|
_op("value_type", "get", "ValueType", "get", ("value_type_rid",), optional=("preview",)),
|
|
145
145
|
_op(
|