From d79c2642e83329eba5910cc8b93e8713176ca4cd 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 cb041be..8cd0a3d 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,3 +1,6 @@ __author__ = 'socket.dev' __version__ = '2.6.8' -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 24e8e96..b5a4972 100644 --- a/socketsecurity/socketcli.py +++ b/socketsecurity/socketcli.py @@ -11,6 +11,7 @@ from socketdev import socketdev from socketdev.fullscans import FullScanParams +from socketsecurity import USER_AGENT_NAME from socketsecurity.config import CliConfig from socketsecurity.core import Core from socketsecurity.core.classes import Diff @@ -108,7 +109,7 @@ def get_api_request_timeout(config: CliConfig) -> int: 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),