From a4cc539c8b2ac7b49dde88aa52b4b8bf284187b6 Mon Sep 17 00:00:00 2001 From: jdalton Date: Thu, 27 Aug 2026 14:43:41 -0400 Subject: [PATCH] feat(user-agent): rename the client to socket-python-cli Socket's public APIs read the User-Agent to attribute a request, and every other Socket client names itself in lowercase-hyphen form. The camel-case name was the odd one out. The name lived as a literal in two places, so a rename could half-apply. Both now read USER_AGENT_NAME from socketsecurity/__init__.py. depscan accepts SocketPythonCLI/ and socket-python-cli/ both, so attribution carries across the rename with no gap. Nothing breaks if this ships before or after that change. --- socketsecurity/__init__.py | 5 ++++- socketsecurity/socketcli.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index 117c489..75fd0ec 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,3 +1,6 @@ __author__ = 'socket.dev' __version__ = '2.10.9' -USER_AGENT = f'SocketPythonCLI/{__version__}' +# 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),