Visitar URL original
feat(user-agent): rename the client to socket-python-cli by jdalton · Pull Request #320 · SocketDev/socket-python-cli · GitHub
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.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__}'
3 changes: 2 additions & 1 deletion socketsecurity/socketcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down
Loading