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),