From d858925052c07f01d1eb5fd7a1c6d31a8b8d87a5 Mon Sep 17 00:00:00 2001 From: Douglas Coburn Date: Mon, 14 Apr 2025 06:29:22 -0700 Subject: [PATCH 1/5] Update version for deploy --- pyproject.toml | 2 +- socketsecurity/__init__.py | 2 +- socketsecurity/core/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6e3e07f..dff296c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.0.43" +version = "2.0.44" requires-python = ">= 3.10" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index beda9f7..222a813 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,2 +1,2 @@ __author__ = 'socket.dev' -__version__ = '2.0.43' +__version__ = '2.0.44' diff --git a/socketsecurity/core/__init__.py b/socketsecurity/core/__init__.py index 67cf0e2..6c1aa09 100644 --- a/socketsecurity/core/__init__.py +++ b/socketsecurity/core/__init__.py @@ -201,7 +201,7 @@ def find_files(self, path: str) -> List[str]: for glob_file in glob_files: if os.path.isfile(glob_file) and not Core.is_excluded(glob_file, self.config.excluded_dirs): - files.add(glob_file) + files.add(glob_file.replace("\\", "/")) glob_end = time.time() log.debug(f"Globbing took {glob_end - glob_start:.4f} seconds") From ea30bbd226dde1e9a9b083d2384d3ac28c9fba5b Mon Sep 17 00:00:00 2001 From: Douglas Coburn Date: Mon, 14 Apr 2025 08:01:58 -0700 Subject: [PATCH 2/5] Version updated --- pyproject.toml | 2 +- socketsecurity/__init__.py | 2 +- socketsecurity/core/__init__.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dff296c..5672fc9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.0.44" +version = "2.0.45" requires-python = ">= 3.10" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index 222a813..57ee496 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,2 +1,2 @@ __author__ = 'socket.dev' -__version__ = '2.0.44' +__version__ = '2.0.45' diff --git a/socketsecurity/core/__init__.py b/socketsecurity/core/__init__.py index 6c1aa09..402cd55 100644 --- a/socketsecurity/core/__init__.py +++ b/socketsecurity/core/__init__.py @@ -304,6 +304,7 @@ def load_files_for_sending(files: List[str], workspace: str) -> List[Tuple[str, key = key.lstrip("/") key = key.lstrip("./") + key = key.lstrip(workspace) f = open(file_path, 'rb') payload = (key, (name, f)) From 68c4398f750fe632c8b92ee2830be3b46c19f1ff Mon Sep 17 00:00:00 2001 From: Douglas Coburn Date: Mon, 14 Apr 2025 08:10:55 -0700 Subject: [PATCH 3/5] Stripping path from file name as well --- pyproject.toml | 2 +- socketsecurity/__init__.py | 2 +- socketsecurity/core/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5672fc9..6f65025 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.0.45" +version = "2.0.46" requires-python = ">= 3.10" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index 57ee496..f5591f0 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,2 +1,2 @@ __author__ = 'socket.dev' -__version__ = '2.0.45' +__version__ = '2.0.46' diff --git a/socketsecurity/core/__init__.py b/socketsecurity/core/__init__.py index 402cd55..1712070 100644 --- a/socketsecurity/core/__init__.py +++ b/socketsecurity/core/__init__.py @@ -307,7 +307,7 @@ def load_files_for_sending(files: List[str], workspace: str) -> List[Tuple[str, key = key.lstrip(workspace) f = open(file_path, 'rb') - payload = (key, (name, f)) + payload = (key, (name.lstrip(workspace), f)) send_files.append(payload) return send_files From 12ff27a8b8c64fbebbea139f48d04c224dc0897b Mon Sep 17 00:00:00 2001 From: Douglas Coburn Date: Mon, 14 Apr 2025 08:18:40 -0700 Subject: [PATCH 4/5] Fixing workspace name --- pyproject.toml | 2 +- socketsecurity/__init__.py | 2 +- socketsecurity/core/__init__.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6f65025..83ffb8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.0.46" +version = "2.0.47" requires-python = ">= 3.10" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index f5591f0..4e6c005 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,2 +1,2 @@ __author__ = 'socket.dev' -__version__ = '2.0.46' +__version__ = '2.0.47' diff --git a/socketsecurity/core/__init__.py b/socketsecurity/core/__init__.py index 1712070..0a1c31a 100644 --- a/socketsecurity/core/__init__.py +++ b/socketsecurity/core/__init__.py @@ -290,7 +290,8 @@ def load_files_for_sending(files: List[str], workspace: str) -> List[Tuple[str, [(field_name, (filename, file_object)), ...] """ send_files = [] - + if "\\" in workspace: + workspace = workspace.replace("\\", "/") for file_path in files: if "/" in file_path: _, name = file_path.rsplit("/", 1) From 027fb673eaf2539dc3688e394da34c10d8c7e287 Mon Sep 17 00:00:00 2001 From: Douglas Coburn Date: Mon, 14 Apr 2025 08:29:29 -0700 Subject: [PATCH 5/5] Removed redundant strip --- pyproject.toml | 2 +- socketsecurity/__init__.py | 2 +- socketsecurity/core/__init__.py | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 83ffb8f..4355a42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.0.47" +version = "2.0.48" requires-python = ">= 3.10" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index 4e6c005..92c21d0 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,2 +1,2 @@ __author__ = 'socket.dev' -__version__ = '2.0.47' +__version__ = '2.0.48' diff --git a/socketsecurity/core/__init__.py b/socketsecurity/core/__init__.py index 0a1c31a..a5925a6 100644 --- a/socketsecurity/core/__init__.py +++ b/socketsecurity/core/__init__.py @@ -293,10 +293,7 @@ def load_files_for_sending(files: List[str], workspace: str) -> List[Tuple[str, if "\\" in workspace: workspace = workspace.replace("\\", "/") for file_path in files: - if "/" in file_path: - _, name = file_path.rsplit("/", 1) - else: - name = file_path + _, name = file_path.rsplit("/", 1) if file_path.startswith(workspace): key = file_path[len(workspace):] @@ -305,7 +302,6 @@ def load_files_for_sending(files: List[str], workspace: str) -> List[Tuple[str, key = key.lstrip("/") key = key.lstrip("./") - key = key.lstrip(workspace) f = open(file_path, 'rb') payload = (key, (name.lstrip(workspace), f))