From a2e8bc6c5bf3754f423aae4e8b75620c9f440efb Mon Sep 17 00:00:00 2001 From: jdalton Date: Mon, 12 Oct 2026 01:38:57 -0400 Subject: [PATCH] feat(user-agent): rename client to socket-python-cli --- CHANGELOG.md | 7 +++++++ pyproject.toml | 2 +- socketsecurity/__init__.py | 7 +++++-- socketsecurity/socketcli.py | 3 ++- uv.lock | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f59b5da..0691f11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 2.10.11 + +### Changed: use lowercase hyphenated Python CLI User-Agent + +- Use `socket-python-cli/` consistently for CLI and SDK requests so API + attribution matches the Socket client naming convention. + ## 2.10.10 ### Changed: bump pinned @coana-tech/cli to 15.12.3 diff --git a/pyproject.toml b/pyproject.toml index 5edc3d6..36d7e47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.10.10" +version = "2.10.11" requires-python = ">= 3.11" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index 19bf8b3..c12a06e 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,3 +1,6 @@ __author__ = 'socket.dev' -__version__ = '2.10.10' -USER_AGENT = f'SocketPythonCLI/{__version__}' +__version__ = '2.10.11' +# The name Socket's API attributes this client by. Callers that build their +# own User-Agent read it from here, so a rename lands in one place. +USER_AGENT_NAME = 'socket-python-cli' +USER_AGENT = f'{USER_AGENT_NAME}/{__version__}' diff --git a/socketsecurity/socketcli.py b/socketsecurity/socketcli.py index 704f1fc..1962037 100644 --- a/socketsecurity/socketcli.py +++ b/socketsecurity/socketcli.py @@ -12,6 +12,7 @@ from socketdev import socketdev from socketdev.fullscans import FullScanParams +from socketsecurity import USER_AGENT_NAME from socketsecurity.config import CliConfig, truncate_commit_message from socketsecurity.core import Core from socketsecurity.core.classes import Diff @@ -240,7 +241,7 @@ def apply_git_context(config: CliConfig) -> Tuple[bool, Optional[Git]]: def build_socket_sdk(config: CliConfig) -> socketdev: - cli_user_agent_string = f"SocketPythonCLI/{config.version}" + cli_user_agent_string = f"{USER_AGENT_NAME}/{config.version}" return socketdev( token=config.api_token, timeout=get_api_request_timeout(config), diff --git a/uv.lock b/uv.lock index c501816..6df942c 100644 --- a/uv.lock +++ b/uv.lock @@ -1292,7 +1292,7 @@ wheels = [ [[package]] name = "socketsecurity" -version = "2.10.10" +version = "2.10.11" source = { editable = "." } dependencies = [ { name = "beautifulsoup4" },