From 73cd95157b6199ffb76519b1a4c7f198eeade0f7 Mon Sep 17 00:00:00 2001 From: Douglas Coburn Date: Fri, 27 Feb 2026 10:01:23 -0800 Subject: [PATCH 1/4] Fixing issue with workspace by updating to new SDK version --- pyproject.toml | 4 ++-- socketsecurity/__init__.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1a59754..c11d634 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.2.74" +version = "2.2.75" requires-python = ">= 3.10" license = {"file" = "LICENSE"} dependencies = [ @@ -16,7 +16,7 @@ dependencies = [ 'GitPython', 'packaging', 'python-dotenv', - "socketdev>=3.0.31,<4.0.0", + "socketdev>=3.0.32,<4.0.0", "bs4>=0.0.2", "markdown>=3.10", ] diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index bee5bcf..440c08b 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,3 +1,3 @@ __author__ = 'socket.dev' -__version__ = '2.2.74' +__version__ = '2.2.75' USER_AGENT = f'SocketPythonCLI/{__version__}' From 4fc120bb0b769018cca4becc17adf3da087a6cb2 Mon Sep 17 00:00:00 2001 From: Douglas Coburn Date: Fri, 27 Feb 2026 10:53:23 -0800 Subject: [PATCH 2/4] Fixing the no workspace specified --- pyproject.toml | 2 +- socketsecurity/__init__.py | 2 +- socketsecurity/socketcli.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c11d634..677e9d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.2.75" +version = "2.2.76" requires-python = ">= 3.10" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index 440c08b..26b4f4e 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,3 +1,3 @@ __author__ = 'socket.dev' -__version__ = '2.2.75' +__version__ = '2.2.76' USER_AGENT = f'SocketPythonCLI/{__version__}' diff --git a/socketsecurity/socketcli.py b/socketsecurity/socketcli.py index 6f17f58..f158efc 100644 --- a/socketsecurity/socketcli.py +++ b/socketsecurity/socketcli.py @@ -465,7 +465,7 @@ def main_code(): set_as_pending_head=is_default_branch, tmp=False, scan_type='socket_tier1' if config.reach else 'socket', - workspace=config.workspace or None, + workspace=config.workspace or "", ) params.include_license_details = not config.exclude_license_details From a7c1b9c020403dedebfc09aa32761d991f88184a Mon Sep 17 00:00:00 2001 From: lelia Date: Tue, 3 Mar 2026 11:51:49 -0500 Subject: [PATCH 3/4] Fix e2e regression where CLI sent empty query param (workspace=) when flag is not provided Signed-off-by: lelia --- socketsecurity/socketcli.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/socketsecurity/socketcli.py b/socketsecurity/socketcli.py index f158efc..af2c1d2 100644 --- a/socketsecurity/socketcli.py +++ b/socketsecurity/socketcli.py @@ -24,6 +24,15 @@ load_dotenv() +def _normalize_workspace(workspace): + """Return None for unset/blank workspace values so SDK omits query param.""" + if workspace is None: + return None + if isinstance(workspace, str): + normalized = workspace.strip() + return normalized or None + return workspace + def cli(): try: main_code() @@ -465,7 +474,7 @@ def main_code(): set_as_pending_head=is_default_branch, tmp=False, scan_type='socket_tier1' if config.reach else 'socket', - workspace=config.workspace or "", + workspace=_normalize_workspace(config.workspace), ) params.include_license_details = not config.exclude_license_details From 5530183c54ea1a3b618581f570595b84c4a0386c Mon Sep 17 00:00:00 2001 From: lelia Date: Tue, 3 Mar 2026 11:52:11 -0500 Subject: [PATCH 4/4] Add unittest to account for new workspace functionality Signed-off-by: lelia --- tests/unit/test_socketcli_workspace.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/unit/test_socketcli_workspace.py diff --git a/tests/unit/test_socketcli_workspace.py b/tests/unit/test_socketcli_workspace.py new file mode 100644 index 0000000..491d917 --- /dev/null +++ b/tests/unit/test_socketcli_workspace.py @@ -0,0 +1,18 @@ +from socketsecurity.socketcli import _normalize_workspace + + +def test_normalize_workspace_none(): + assert _normalize_workspace(None) is None + + +def test_normalize_workspace_empty_string(): + assert _normalize_workspace("") is None + + +def test_normalize_workspace_whitespace_string(): + assert _normalize_workspace(" ") is None + + +def test_normalize_workspace_valid_string(): + assert _normalize_workspace("my-workspace") == "my-workspace" +