Skip to content

Commit 5e801c7

Browse files
leliaclaude
andcommitted
feat(purl): adopt socketdev 3.4.2 typed batch params (CE-360)
The core-tool-watch scoring call opted into the batch purl API's fail-closed semantics via stringly-typed query-string kwargs (poll="true", timeoutSec="120", alerts="true") -- an undocumented SDK passthrough. socketdev 3.4.2 promotes these to first-class typed params; migrate to the supported surface and raise the dependency floor. Behavior unchanged (still fail-closed). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent f3d412c commit 5e801c7

3 files changed

Lines changed: 14 additions & 13 deletions

File tree

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dependencies = [
2828
"light-s3-client~=0.0.30",
2929
"PyYAML>=6.0.0",
3030
"tomli; python_version < '3.11'",
31-
"socketdev>=3.3.0",
31+
"socketdev>=3.4.2",
3232
"jsonschema>=4.25.1"
3333
]
3434

‎scripts/check_core_tools.py‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -315,17 +315,18 @@ def analyze_purls(purls: list[str], token: str) -> dict[str, dict[str, Any]]:
315315
components = [{"purl": p} for p in purls]
316316
# The batch purl endpoints default to fail-open: inputs whose analysis is
317317
# pending or unresolvable are silently omitted from the response unless the
318-
# caller opts in. Opt in to fail-closed semantics: poll=true waits (bounded
319-
# by timeoutSec; the server may cap it) for pending analysis, and
320-
# alerts=true materializes still-unresolved inputs as synthetic
321-
# pendingScan/notFound rows instead of dropping them. The SDK passes these
322-
# extra kwargs through as query params (verified on 3.0.29 and 3.3.0).
318+
# caller opts in. Opt in to fail-closed semantics: poll=True waits (bounded
319+
# by timeout_sec; the server may cap it) for pending analysis, and
320+
# alerts=True materializes still-unresolved inputs as synthetic
321+
# pendingScan/notFound rows instead of dropping them. These are first-class
322+
# typed params as of socketdev 3.4.2 (previously passed as stringly-typed
323+
# query-string kwargs); see CE-360.
323324
results = client.purl.post(
324325
license="false",
325326
components=components,
326-
poll="true",
327-
timeoutSec="120",
328-
alerts="true",
327+
poll=True,
328+
timeout_sec=120,
329+
alerts=True,
329330
**kwargs,
330331
) or []
331332
if not results:

‎uv.lock‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)