Skip to content

Fix Socket API: correct endpoints, response parsing, and version listing#9

Merged
hammadtq merged 1 commit intomainfrom
fix/socket-availability-check
Apr 2, 2026
Merged

Fix Socket API: correct endpoints, response parsing, and version listing#9
hammadtq merged 1 commit intomainfrom
fix/socket-availability-check

Conversation

@hammadtq
Copy link
Copy Markdown
Collaborator

@hammadtq hammadtq commented Apr 2, 2026

Summary

Fixes three pre-existing bugs in the Socket.dev provider adapter that caused every evaluation to return provider unavailable:

  • IsAvailable hit /v0 root (always 404). Now uses /v0/quota (zero-cost health check)
  • GetPackageScore passed version as query param. Socket API expects it in the path
  • ListVersions called a non-existent endpoint. Now fetches versions from npm registry and scores top 10 via Socket
  • Overall score parsed from non-existent response field. Now uses depscore

Test plan

  • go vet and go test pass
  • evaluate npm install axios returns allow with real scores
  • Needs a new release (v0.1.1) since the binary changed

Generated with Claude Code

Three pre-existing bugs fixed:
- IsAvailable hit /v0 root (404). Now uses /v0/quota (zero-cost).
- GetPackageScore used query param for version. Now uses path: /v0/{eco}/{name}/{version}/score
- ListVersions called a non-existent Socket endpoint. Now fetches versions from the npm registry and scores the top 10 candidates via Socket.
- Overall score parsed from non-existent `overall.score` field. Now uses `depscore`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hammadtq hammadtq merged commit a987bb0 into main Apr 2, 2026
2 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