Added more logs and optional ignore-ssl #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Add defensive HTTP handling and optional SSL verification bypass to avoid JSON parsing errors on non-200 responses and to support testing against self-signed certificates or proxies.
Expose a --ignore-ssl CLI flag and document it in README.md.
Key changes
Validate HTTP response status codes before attempting json parsing and return gracefully on errors.
Wrap response.json() parsing in try/except to handle empty/invalid JSON.
Log snyk-request-id and response.text for non-200 responses to aid debugging.
Make TLS verification configurable via the CLI flag --ignore-ssl and pass the resulting verify value into verify_org_integrations, get_all_targets, and migrate_targets.
Improve error output in migrate_targets (safe header access and include response body).
Document the new --ignore-ssl flag and its security warning in README.md.
Notes
On non-200 responses the tool now prints debug info and returns safely instead of raising JSONDecodeError.
Default behavior remains secure (TLS verification enabled). --ignore-ssl must be explicitly passed to disable verification.
Pagination logic and existing functionality preserved.
--ignore-ssl is insecure; the README includes a clear warning. Default remains verify=True.