Skip to content

Update OSS Index datasource for Sonatype Guide - #2312

Open
GHX5T-SOL wants to merge 1 commit into
aboutcode-org:mainfrom
GHX5T-SOL:fix/2311-sonatype-guide-migration
Open

GHX5T-SOL wants to merge 1 commit into
aboutcode-org:mainfrom
GHX5T-SOL:fix/2311-sonatype-guide-migration

Conversation

@GHX5T-SOL

Copy link
Copy Markdown

Closes #2311.

Summary:

  • Point the OSS Index datasource at Sonatype Guide compatibility API endpoints.
  • Keep the existing OSS Index-compatible request/response parsing behavior.
  • Add focused no-network tests for unauthenticated and authenticated endpoint selection.

Validation:

  • .venv/bin/python -m pytest vulntotal/tests/test_oss_index.py -q (3 passed; local Python 3.14 required pytest 9.0.3 because repo-pinned pytest 7.1.1 errors before collection on Python 3.14)
  • .venv/bin/python -m black --check vulntotal/datasources/oss_index.py vulntotal/tests/test_oss_index.py
  • .venv/bin/python -m isort --check-only vulntotal/datasources/oss_index.py vulntotal/tests/test_oss_index.py
  • git diff --check
  • git diff --cached --check
  • git diff --no-ext-diff | gitleaks stdin --no-banner --redact --exit-code 1
  • git diff --cached --no-ext-diff | gitleaks stdin --no-banner --redact --exit-code 1

Limitations:

  • Full make test was not run locally; this was validated with a minimal focused virtualenv on Python 3.14.

Signed-off-by: Ghxst <200635707+GHX5T-SOL@users.noreply.github.com>
@GHX5T-SOL
GHX5T-SOL force-pushed the fix/2311-sonatype-guide-migration branch from 9a13cb3 to 0d56b21 Compare May 25, 2026 18:34
@Jean-Regis-M

Copy link
Copy Markdown

Thanks for the early fix for #2311. For the maintainers' reference: I compared this with #2503, which covers the same issue. Both switch to api.guide.sonatype.com correctly, and the tests pass on both. #2503 also adds Sonatype Guide PAT support (SONATYPE_GUIDE_TOKEN, no username needed) and loads .env. That matters now that the API returns 401 for anonymous requests. I've asked for a fix there (it registers the datasource twice). One gap here is that PAT users still have to set OSS_USERNAME. The choice is the maintainers', and this PR is a solid minimal option if they prefer a smaller change.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace OSSindex with new Sonatype Guide

2 participants