⚠️ DO NOT MERGE until backend changes are confirmed deployed ⚠️
The Python SDK defaults to SocketSDKPython/<version>, while the Python CLI is moving to a lowercase product name. Use socket-sdk-python/<SDK version> for standalone SDK requests and preserve every explicit caller override, including CLI and Basics identities.
Blocked on backend deployment. Keep this PR in draft and do not merge or release it until depscan recognizes both SDK prefixes and attributes them to py-sdk. Backend dependency raised as PR. Client releases must follow deployment, not merely backend PR merge.
Public Changelog
Use a consistent lowercase Python SDK User-Agent while preserving application-specific overrides.
Validation
- 206 SDK unit tests passed, 1 skipped, and 82 subtests passed. Wheel metadata, source archive, runtime, and default User-Agent all report
3.6.3.
- Prepared HTTP requests cover the default identity, legacy and lowercase CLI overrides, Basics and arbitrary overrides, an explicitly empty override, GET requests, and multipart POST uploads.
- Ruff passed for the new module and tests;
git diff --check passed. Added code contains no comments requiring revision in the fourth-wall audit.
Rollout and reviewer context
- Prior art: feat(user-agent): rename the client to socket-python-cli socket-python-cli#320 by jdalton. The CLI identifies itself when using the SDK; standalone SDK consumers retain the SDK identity.
- This draft targets SDK
3.6.3; the package version and changelog are prepared for that release. Backend deployment remains a prerequisite for merging or releasing.
- The backend must retain
SocketSDKPython/ as an alias so existing SDK clients remain recognizable.
Note
Medium Risk
Default User-Agent changes how the API attributes traffic until the backend maps the new prefix (and legacy SocketSDKPython/); rollout is coordinated with depscan deployment.
Overview
Stand-alone SDK HTTP requests now send socket-sdk-python/{version} instead of SocketSDKPython/{version}, centralizing the default in a new socketdev/user_agent module consumed by API.do_request.
Behavior for user_agent= is unchanged: explicit values (including empty string) still replace the default so the CLI, Basics, and other wrappers can identify themselves. README and an Unreleased changelog entry document the new default.
New unit tests assert the default header on direct do_request calls and on endpoint wrappers (org.get, basics.get_config), plus GET/POST and several override strings.
Reviewed by Cursor Bugbot for commit 847da08. Configure here.