Repository navigation
feat(user-agent): rename the client to socket-python-cli - #320
John-David Dalton (jdalton) wants to merge 1 commit into
Conversation
lelia
left a comment
There was a problem hiding this comment.
John-David Dalton (@jdalton) thanks for adding this, but I think we need to implement backend changes first before we rename on the client side.
I confirmed that backend attribution currently matches user-agents on exact, case sensitive prefixes, and currently only SocketPythonCLI/ is registered, meaning that this rename will cause us to silently lose Python CLI attribution as users upgrade.
By the way, the same class of change needs to take place on the SDK side, too - in fact, the SocketSDKPython/ user-agent appears to have never been registered on the backend. We may as well fix the gap everywhere in one go, if you're up for it.
d79c264 to
a4cc539
Compare
|
The backend attribution support now accepts both SocketPythonCLI/ and socket-python-cli/, and adds SocketSDKPython/ attribution. It is deployed to prod. |
c77895c to
a2e8bc6
Compare
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.