feat(user-agent): rename the client to socket-python-cli - #320
Open
John-David Dalton (jdalton) wants to merge 1 commit into
Open
feat(user-agent): rename the client to socket-python-cli#320John-David Dalton (jdalton) wants to merge 1 commit into
John-David Dalton (jdalton) wants to merge 1 commit into
Conversation
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.
|
❌ Version Check Failed Please increment... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Socket's public APIs read the User-Agent to attribute a request, and every other Socket client names itself in lowercase-hyphen form. This renames
SocketPythonCLI/tosocket-python-cli/and collapses the two copies of the name into one constant.Why one constant
The name was a literal in two places:
socketsecurity/__init__.pybuiltUSER_AGENTfrom it, andbuild_socket_sdkinsocketsecurity/socketcli.pyrebuilt the same string by hand for the SDK'suser_agentoverride. A rename could half-apply and leave the CLI reporting two different names depending on the call path.Both now read
USER_AGENT_NAMEfromsocketsecurity/__init__.py.config.versionalready defaults to__version__, so the SDK override keeps reporting exactly what it did before.Rollout
There is no coordination needed. Socket's API-side attribution already accepts the old and the new name both, so the rename carries across with no gap and nothing breaks whether this ships first or second.
Both changed files parse (
python3 -m ast), and no occurrence of the old name remains in the repo.Note
Low Risk
Metadata-only User-Agent string change with no auth or scan logic touched; API attribution is described as accepting both old and new names.
Overview
Renames the Python CLI’s User-Agent client identifier from
SocketPythonCLI/tosocket-python-cli/, matching Socket’s lowercase-hyphen convention for API attribution.Introduces
USER_AGENT_NAMEinsocketsecurity/__init__.pyand buildsUSER_AGENTfrom it, so the SDK setup inbuild_socket_sdkno longer duplicates a hardcoded name and stays consistent withCliClientheaders that already readUSER_AGENT.Reviewed by Cursor Bugbot for commit d79c264. Configure here.