From ffcc07b7e2566ad915a52cdac270915104955cd6 Mon Sep 17 00:00:00 2001 From: jdalton Date: Thu, 27 Aug 2026 14:43:41 -0400 Subject: [PATCH] feat(user-agent): rename client to socket-python-cli Use one client name for CLI and SDK requests. Preserve the current release version and record the change under Unreleased. --- CHANGELOG.md | 6 ++++++ socketsecurity/__init__.py | 3 ++- socketsecurity/socketcli.py | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ed1b32..95c4c26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Changed: use lowercase Python CLI User-Agent + +- Use `socket-python-cli/` consistently for CLI and SDK requests. + ## 2.11.7 ### Changed: bump pinned Coana CLI to 15.13.3 diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index 3519880..f2a282c 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,3 +1,4 @@ __author__ = 'socket.dev' __version__ = '2.11.7' -USER_AGENT = f'SocketPythonCLI/{__version__}' +USER_AGENT_NAME = 'socket-python-cli' +USER_AGENT = f'{USER_AGENT_NAME}/{__version__}' diff --git a/socketsecurity/socketcli.py b/socketsecurity/socketcli.py index a3213f4..2af7507 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),