cycode 3.8.8.dev1__tar.gz → 3.8.9__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.
- {cycode-3.8.8.dev1 → cycode-3.8.9}/PKG-INFO +1 -1
- cycode-3.8.9/cycode/__init__.py +1 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report/sbom/repository_url/repository_url_command.py +10 -1
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/remote_url_resolver.py +9 -2
- cycode-3.8.9/cycode/cli/utils/url_utils.py +64 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/report_client.py +9 -1
- {cycode-3.8.8.dev1 → cycode-3.8.9}/pyproject.toml +1 -1
- cycode-3.8.8.dev1/cycode/__init__.py +0 -1
- {cycode-3.8.8.dev1 → cycode-3.8.9}/LICENCE +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/README.md +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/__main__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/app.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/ai_remediation/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/ai_remediation/ai_remediation_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/ai_remediation/apply_fix.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/ai_remediation/print_remediation.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/auth/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/auth/auth_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/auth/auth_common.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/auth/auth_manager.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/auth/models.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/configure/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/configure/configure_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/configure/consts.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/configure/messages.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/configure/prompts.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/ignore/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/ignore/ignore_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/mcp/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/mcp/mcp_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report/report_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report/sbom/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report/sbom/common.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report/sbom/path/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report/sbom/path/path_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report/sbom/repository_url/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report/sbom/sbom_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report/sbom/sbom_report_file.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report_import/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report_import/report_import_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report_import/sbom/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/report_import/sbom/sbom_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/aggregation_report.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/code_scanner.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/commit_history/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/commit_history/commit_history_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/commit_range_scanner.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/detection_excluder.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/path/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/path/path_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/pre_commit/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/pre_commit/pre_commit_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/pre_push/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/pre_push/pre_push_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/pre_receive/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/pre_receive/pre_receive_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/repository/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/repository/repository_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/scan_ci/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/scan_ci/ci_integrations.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/scan_ci/scan_ci_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/scan_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/scan_parameters.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/scan_result.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/status/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/status/get_cli_status.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/status/models.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/status/status_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/status/version_command.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/cli_types.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/config.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/console.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/consts.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/exceptions/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/exceptions/custom_exceptions.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/exceptions/handle_ai_remediation_errors.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/exceptions/handle_auth_errors.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/exceptions/handle_errors.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/exceptions/handle_report_sbom_errors.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/exceptions/handle_scan_errors.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/commit_range_documents.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/documents_walk_ignore.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/file_excluder.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/iac/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/iac/tf_content_generator.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/models/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/models/in_memory_zip.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/path_documents.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/repository_documents.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/base_restore_dependencies.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/go/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/go/restore_go_dependencies.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/maven/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/maven/restore_gradle_dependencies.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/maven/restore_maven_dependencies.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/npm/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/npm/restore_npm_dependencies.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/nuget/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/nuget/restore_nuget_dependencies.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/ruby/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/ruby/restore_ruby_dependencies.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/sbt/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/sbt/restore_sbt_dependencies.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/sca_file_collector.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/walk_ignore.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/zip_documents.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/logger.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/main.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/models.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/console_printer.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/json_printer.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/printer_base.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/rich_printer.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/tables/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/tables/sca_table_printer.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/tables/table.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/tables/table_models.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/tables/table_printer.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/tables/table_printer_base.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/text_printer.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/utils/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/utils/code_snippet_syntax.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/utils/detection_data.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/utils/detection_ordering/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/utils/detection_ordering/common_ordering.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/utils/detection_ordering/sca_ordering.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/utils/rich_helpers.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/user_settings/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/user_settings/base_file_manager.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/user_settings/config_file_manager.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/user_settings/configuration_manager.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/user_settings/credentials_manager.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/user_settings/jwt_creator.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/enum_utils.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/get_api_client.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/git_proxy.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/ignore_utils.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/jwt_utils.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/path_utils.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/progress_bar.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/scan_batch.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/scan_utils.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/sentry.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/shell_executor.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/string_utils.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/task_timer.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/version_checker.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/utils/yaml_utils.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/config.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/__init__.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/auth_client.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/base_token_auth_client.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/client_creator.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/config.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/config_dev.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/cycode_client.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/cycode_client_base.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/cycode_dev_based_client.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/cycode_oidc_based_client.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/cycode_token_based_client.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/headers.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/import_sbom_client.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/logger.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/models.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/scan_client.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cyclient/scan_config_base.py +0 -0
- {cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/logger.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '3.8.9' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
|
|
@@ -8,6 +8,10 @@ from cycode.cli.exceptions.handle_report_sbom_errors import handle_report_except
|
|
|
8
8
|
from cycode.cli.utils.get_api_client import get_report_cycode_client
|
|
9
9
|
from cycode.cli.utils.progress_bar import SbomReportProgressBarSection
|
|
10
10
|
from cycode.cli.utils.sentry import add_breadcrumb
|
|
11
|
+
from cycode.cli.utils.url_utils import sanitize_repository_url
|
|
12
|
+
from cycode.logger import get_logger
|
|
13
|
+
|
|
14
|
+
logger = get_logger('Repository URL Command')
|
|
11
15
|
|
|
12
16
|
|
|
13
17
|
def repository_url_command(
|
|
@@ -28,8 +32,13 @@ def repository_url_command(
|
|
|
28
32
|
start_scan_time = time.time()
|
|
29
33
|
report_execution_id = -1
|
|
30
34
|
|
|
35
|
+
# Sanitize repository URL to remove any embedded credentials/tokens before sending to API
|
|
36
|
+
sanitized_uri = sanitize_repository_url(uri)
|
|
37
|
+
if sanitized_uri != uri:
|
|
38
|
+
logger.debug('Sanitized repository URL to remove credentials')
|
|
39
|
+
|
|
31
40
|
try:
|
|
32
|
-
report_execution = client.request_sbom_report_execution(report_parameters, repository_url=
|
|
41
|
+
report_execution = client.request_sbom_report_execution(report_parameters, repository_url=sanitized_uri)
|
|
33
42
|
report_execution_id = report_execution.id
|
|
34
43
|
|
|
35
44
|
create_sbom_report(progress_bar, client, report_execution_id, output_file, output_format)
|
|
@@ -3,6 +3,7 @@ from typing import Optional
|
|
|
3
3
|
from cycode.cli import consts
|
|
4
4
|
from cycode.cli.utils.git_proxy import git_proxy
|
|
5
5
|
from cycode.cli.utils.shell_executor import shell
|
|
6
|
+
from cycode.cli.utils.url_utils import sanitize_repository_url
|
|
6
7
|
from cycode.logger import get_logger
|
|
7
8
|
|
|
8
9
|
logger = get_logger('Remote URL Resolver')
|
|
@@ -102,7 +103,11 @@ def _try_get_git_remote_url(path: str) -> Optional[str]:
|
|
|
102
103
|
repo = git_proxy.get_repo(path, search_parent_directories=True)
|
|
103
104
|
remote_url = repo.remotes[0].config_reader.get('url')
|
|
104
105
|
logger.debug('Found Git remote URL, %s', {'remote_url': remote_url, 'repo_path': repo.working_dir})
|
|
105
|
-
|
|
106
|
+
# Sanitize URL to remove any embedded credentials/tokens before returning
|
|
107
|
+
sanitized_url = sanitize_repository_url(remote_url)
|
|
108
|
+
if sanitized_url != remote_url:
|
|
109
|
+
logger.debug('Sanitized repository URL to remove credentials')
|
|
110
|
+
return sanitized_url
|
|
106
111
|
except Exception as e:
|
|
107
112
|
logger.debug('Failed to get Git remote URL. Probably not a Git repository', exc_info=e)
|
|
108
113
|
return None
|
|
@@ -124,7 +129,9 @@ def get_remote_url_scan_parameter(paths: tuple[str, ...]) -> Optional[str]:
|
|
|
124
129
|
# - len(paths)*2 Plastic SCM subprocess calls
|
|
125
130
|
remote_url = _try_get_any_remote_url(path)
|
|
126
131
|
if remote_url:
|
|
127
|
-
|
|
132
|
+
# URLs are already sanitized in _try_get_git_remote_url, but sanitize again as safety measure
|
|
133
|
+
sanitized_url = sanitize_repository_url(remote_url)
|
|
134
|
+
remote_urls.add(sanitized_url)
|
|
128
135
|
|
|
129
136
|
if len(remote_urls) == 1:
|
|
130
137
|
# we are resolving remote_url only if all paths belong to the same repo (identical remote URLs),
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from urllib.parse import urlparse, urlunparse
|
|
3
|
+
|
|
4
|
+
from cycode.logger import get_logger
|
|
5
|
+
|
|
6
|
+
logger = get_logger('URL Utils')
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def sanitize_repository_url(url: Optional[str]) -> Optional[str]:
|
|
10
|
+
"""Remove credentials (username, password, tokens) from repository URL.
|
|
11
|
+
|
|
12
|
+
This function sanitizes repository URLs to prevent sending PAT tokens or other
|
|
13
|
+
credentials to the API. It handles both HTTP/HTTPS URLs with embedded credentials
|
|
14
|
+
and SSH URLs (which are returned as-is since they don't contain credentials in the URL).
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
url: Repository URL that may contain credentials (e.g., https://token@github.com/user/repo.git)
|
|
18
|
+
|
|
19
|
+
Returns:
|
|
20
|
+
Sanitized URL without credentials (e.g., https://github.com/user/repo.git), or None if input is None
|
|
21
|
+
|
|
22
|
+
Examples:
|
|
23
|
+
>>> sanitize_repository_url('https://token@github.com/user/repo.git')
|
|
24
|
+
'https://github.com/user/repo.git'
|
|
25
|
+
>>> sanitize_repository_url('https://user:token@github.com/user/repo.git')
|
|
26
|
+
'https://github.com/user/repo.git'
|
|
27
|
+
>>> sanitize_repository_url('git@github.com:user/repo.git')
|
|
28
|
+
'git@github.com:user/repo.git'
|
|
29
|
+
>>> sanitize_repository_url(None)
|
|
30
|
+
None
|
|
31
|
+
"""
|
|
32
|
+
if not url:
|
|
33
|
+
return url
|
|
34
|
+
|
|
35
|
+
# Handle SSH URLs - no credentials to remove
|
|
36
|
+
# ssh:// URLs have the format ssh://git@host/path
|
|
37
|
+
if url.startswith('ssh://'):
|
|
38
|
+
return url
|
|
39
|
+
# git@host:path format (scp-style)
|
|
40
|
+
if '@' in url and '://' not in url and url.startswith('git@'):
|
|
41
|
+
return url
|
|
42
|
+
|
|
43
|
+
try:
|
|
44
|
+
parsed = urlparse(url)
|
|
45
|
+
# Remove username and password from netloc
|
|
46
|
+
# Reconstruct URL without credentials
|
|
47
|
+
sanitized_netloc = parsed.hostname
|
|
48
|
+
if parsed.port:
|
|
49
|
+
sanitized_netloc = f'{sanitized_netloc}:{parsed.port}'
|
|
50
|
+
|
|
51
|
+
return urlunparse(
|
|
52
|
+
(
|
|
53
|
+
parsed.scheme,
|
|
54
|
+
sanitized_netloc,
|
|
55
|
+
parsed.path,
|
|
56
|
+
parsed.params,
|
|
57
|
+
parsed.query,
|
|
58
|
+
parsed.fragment,
|
|
59
|
+
)
|
|
60
|
+
)
|
|
61
|
+
except Exception as e:
|
|
62
|
+
logger.debug('Failed to sanitize repository URL, returning original, %s', {'url': url, 'error': str(e)})
|
|
63
|
+
# If parsing fails, return original URL to avoid breaking functionality
|
|
64
|
+
return url
|
|
@@ -6,8 +6,12 @@ from requests import Response
|
|
|
6
6
|
|
|
7
7
|
from cycode.cli.exceptions.custom_exceptions import CycodeError
|
|
8
8
|
from cycode.cli.files_collector.models.in_memory_zip import InMemoryZip
|
|
9
|
+
from cycode.cli.utils.url_utils import sanitize_repository_url
|
|
9
10
|
from cycode.cyclient import models
|
|
10
11
|
from cycode.cyclient.cycode_client_base import CycodeClientBase
|
|
12
|
+
from cycode.logger import get_logger
|
|
13
|
+
|
|
14
|
+
logger = get_logger('Report Client')
|
|
11
15
|
|
|
12
16
|
|
|
13
17
|
@dataclasses.dataclass
|
|
@@ -49,7 +53,11 @@ class ReportClient:
|
|
|
49
53
|
# entity type required only for zipped-file
|
|
50
54
|
request_data = {'report_parameters': params.to_json(without_entity_type=zip_file is None)}
|
|
51
55
|
if repository_url:
|
|
52
|
-
|
|
56
|
+
# Sanitize repository URL to remove any embedded credentials/tokens before sending to API
|
|
57
|
+
sanitized_url = sanitize_repository_url(repository_url)
|
|
58
|
+
if sanitized_url != repository_url:
|
|
59
|
+
logger.debug('Sanitized repository URL to remove credentials')
|
|
60
|
+
request_data['repository_url'] = sanitized_url
|
|
53
61
|
|
|
54
62
|
request_args = {
|
|
55
63
|
'url_path': url_path,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '3.8.8.dev1' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/apps/scan/commit_history/commit_history_command.py
RENAMED
|
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
|
|
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
|
{cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/base_restore_dependencies.py
RENAMED
|
File without changes
|
|
File without changes
|
{cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/go/restore_go_dependencies.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/npm/restore_npm_dependencies.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/ruby/restore_ruby_dependencies.py
RENAMED
|
File without changes
|
|
File without changes
|
{cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/files_collector/sca/sbt/restore_sbt_dependencies.py
RENAMED
|
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
|
{cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/utils/detection_ordering/common_ordering.py
RENAMED
|
File without changes
|
{cycode-3.8.8.dev1 → cycode-3.8.9}/cycode/cli/printers/utils/detection_ordering/sca_ordering.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|