Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion socketsecurity/__init__.py
Original file line number Diff line number Diff line change
@@ -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__}'
3 changes: 2 additions & 1 deletion socketsecurity/socketcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down
Loading