Skip to content

feat!: move to the v3 API and tighten the connection - #3

Merged
RejectModders merged 3 commits into
mainfrom
feat/v3-transport
Nov 29, 2026
Merged

RejectModders merged 3 commits into
mainfrom
feat/v3-transport

Conversation

@RejectModders

@RejectModders RejectModders commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Builds on #2. The releases call API versions that no longer exist; this moves the client to /api/v3 and rebuilds the layer that talks to it.

Connection:

  • Redirects are refused. base_url must use https and include the API path; plain http is for this computer only and skips any proxy.
  • Only reads are retried, honouring Retry-After up to 30 seconds. A scan or delete is sent once.
  • The key is hidden from printed settings, cannot be replaced by .netrc, and is not attached to network errors.
  • VULNRADAR_TOKEN and VULNRADAR_API_BASE are read like the command line tool reads them.

Errors:

  • Every failure is an SDK error, with the server's code, request id, Retry-After and reply body.
  • RateLimitError.kind says which limit was reached, for both the 3.9.2 and 4.0 reply formats.

Not working yet: scans on v3 run in the background. scan() and scan_crawl() start one and then raise UnexpectedResponseError with its id, so an unfinished scan is never reported as clean. history.list() raises too, because ids are now text. Following scans and reading history are the next two changes.

Breaking changes are listed in the changelog.

Tested locally on Windows: the 179 offline tests pass on Python 3.11 and 3.13, and ruff and mypy --strict pass on 3.13. Before the last commit, ruff, mypy and the tests also passed on 3.11, 3.12 and 3.13 from a clean copy, with the build, an install using the oldest allowed versions and a dependency audit. Nothing was run against a live server with a real key.

The client calls /api/v3. It refuses redirects and plain http to other
computers, sends a scan or delete only once, keeps the key out of printed
objects and away from .netrc, and reads VULNRADAR_TOKEN like the command
line tool does. Errors carry the server's code and request id, each rate
limit is named, and every network failure is an SDK error.

Scans on v3 run in the background and this does not follow them yet, so a
reply that is not a finished result now raises instead of reading as a
scan with no findings.
A base_url without a path made version() send the key to a host named
"version", and a proxy from the environment would have received plain http
requests to this computer. Both are closed. Deeply nested or impossible
values in a reply now raise SDK errors, and a network error no longer
carries the request that holds the key.
@RejectModders
RejectModders changed the base branch from ci/tooling-and-checks to main November 29, 2026 02:32
@RejectModders
RejectModders merged commit 4dc1dfd into main Nov 29, 2026
13 checks passed
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.

1 participant