socketdev 3.0.13__tar.gz → 3.0.14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. {socketdev-3.0.13 → socketdev-3.0.14}/PKG-INFO +1 -1
  2. {socketdev-3.0.13 → socketdev-3.0.14}/pyproject.toml +1 -1
  3. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/utils/__init__.py +63 -49
  4. socketdev-3.0.14/socketdev/version.py +1 -0
  5. socketdev-3.0.13/socketdev/version.py +0 -1
  6. {socketdev-3.0.13 → socketdev-3.0.14}/.github/CODEOWNERS +0 -0
  7. {socketdev-3.0.13 → socketdev-3.0.14}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
  8. {socketdev-3.0.13 → socketdev-3.0.14}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
  9. {socketdev-3.0.13 → socketdev-3.0.14}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
  10. {socketdev-3.0.13 → socketdev-3.0.14}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  11. {socketdev-3.0.13 → socketdev-3.0.14}/.github/workflows/pr-preview.yml +0 -0
  12. {socketdev-3.0.13 → socketdev-3.0.14}/.github/workflows/release.yml +0 -0
  13. {socketdev-3.0.13 → socketdev-3.0.14}/.github/workflows/version-check.yml +0 -0
  14. {socketdev-3.0.13 → socketdev-3.0.14}/.gitignore +0 -0
  15. {socketdev-3.0.13 → socketdev-3.0.14}/.hooks/sync_version.py +0 -0
  16. {socketdev-3.0.13 → socketdev-3.0.14}/.python-version +0 -0
  17. {socketdev-3.0.13 → socketdev-3.0.14}/LICENSE +0 -0
  18. {socketdev-3.0.13 → socketdev-3.0.14}/README.rst +0 -0
  19. {socketdev-3.0.13 → socketdev-3.0.14}/scripts/build.sh +0 -0
  20. {socketdev-3.0.13 → socketdev-3.0.14}/scripts/deploy-test-pypi.sh +0 -0
  21. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/__init__.py +0 -0
  22. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/alerttypes/__init__.py +0 -0
  23. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/analytics/__init__.py +0 -0
  24. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/apitokens/__init__.py +0 -0
  25. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/auditlog/__init__.py +0 -0
  26. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/basics/__init__.py +0 -0
  27. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/core/api.py +0 -0
  28. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/core/classes.py +0 -0
  29. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/core/dedupe.py +0 -0
  30. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/core/issues.py +0 -0
  31. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/dependencies/__init__.py +0 -0
  32. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/diffscans/__init__.py +0 -0
  33. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/exceptions.py +0 -0
  34. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/export/__init__.py +0 -0
  35. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/fullscans/__init__.py +0 -0
  36. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/historical/__init__.py +0 -0
  37. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/labels/__init__.py +0 -0
  38. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/licensemetadata/__init__.py +0 -0
  39. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/log.py +0 -0
  40. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/npm/__init__.py +0 -0
  41. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/openapi/__init__.py +0 -0
  42. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/org/__init__.py +0 -0
  43. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/purl/__init__.py +0 -0
  44. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/quota/__init__.py +0 -0
  45. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/report/__init__.py +0 -0
  46. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/repos/__init__.py +0 -0
  47. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/repositories/__init__.py +0 -0
  48. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/sbom/__init__.py +0 -0
  49. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/settings/__init__.py +0 -0
  50. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/threatfeed/__init__.py +0 -0
  51. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/tools/__init__.py +0 -0
  52. {socketdev-3.0.13 → socketdev-3.0.14}/socketdev/triage/__init__.py +0 -0
  53. {socketdev-3.0.13 → socketdev-3.0.14}/tests/README.md +0 -0
  54. {socketdev-3.0.13 → socketdev-3.0.14}/tests/conftest.py +0 -0
  55. {socketdev-3.0.13 → socketdev-3.0.14}/tests/integration/test_all_endpoints.py +0 -0
  56. {socketdev-3.0.13 → socketdev-3.0.14}/tests/integration/test_comprehensive_integration.py +0 -0
  57. {socketdev-3.0.13 → socketdev-3.0.14}/tests/integration/test_diffscans_integration.py +0 -0
  58. {socketdev-3.0.13 → socketdev-3.0.14}/tests/integration/test_new_endpoints.py +0 -0
  59. {socketdev-3.0.13 → socketdev-3.0.14}/tests/run_tests.py +0 -0
  60. {socketdev-3.0.13 → socketdev-3.0.14}/tests/unit/__init__.py +0 -0
  61. {socketdev-3.0.13 → socketdev-3.0.14}/tests/unit/test_all_endpoints_unit.py +0 -0
  62. {socketdev-3.0.13 → socketdev-3.0.14}/tests/unit/test_dedupe.py +0 -0
  63. {socketdev-3.0.13 → socketdev-3.0.14}/tests/unit/test_socket_sdk_unit.py +0 -0
  64. {socketdev-3.0.13 → socketdev-3.0.14}/tests/unit/test_working_endpoints_unit.py +0 -0
  65. {socketdev-3.0.13 → socketdev-3.0.14}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: socketdev
3
- Version: 3.0.13
3
+ Version: 3.0.14
4
4
  Summary: Socket Security Python SDK
5
5
  Project-URL: Homepage, https://github.com/socketdev/socketdev
6
6
  Author-email: Douglas Coburn <douglas@socket.dev>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "socketdev"
7
- version = "3.0.13"
7
+ version = "3.0.14"
8
8
  requires-python = ">= 3.9"
9
9
  dependencies = [
10
10
  'requests',
@@ -269,63 +269,77 @@ class Utils:
269
269
  if "\\" in file_path:
270
270
  file_path = file_path.replace("\\", "/")
271
271
 
272
- _, name = file_path.rsplit("/", 1)
272
+ for file_path in files:
273
+ # Normalize file path
274
+ if "\\" in file_path:
275
+ file_path = file_path.replace("\\", "/")
273
276
 
274
- # Calculate the key name for the form data
275
- key = file_path
276
- path_stripped = False
277
-
278
- # If base_paths is provided, try to strip one of the paths from the file path
279
- if base_paths:
280
- for bp in base_paths:
281
- # Normalize base_path to ensure consistent handling of trailing slashes
282
- normalized_base_path = bp.rstrip("/") + "/" if not bp.endswith("/") else bp
277
+ # Skip directories
278
+ if os.path.isdir(file_path):
279
+ continue
280
+
281
+ # Handle file path splitting safely
282
+ if "/" in file_path:
283
+ _, name = file_path.rsplit("/", 1)
284
+ else:
285
+ name = file_path
286
+
287
+ # Calculate the key name for the form data
288
+ key = file_path
289
+ path_stripped = False
290
+
291
+ # If base_paths is provided, try to strip one of the paths from the file path
292
+ if base_paths:
293
+ for bp in base_paths:
294
+ normalized_base_path = bp.rstrip("/") + "/" if not bp.endswith("/") else bp
295
+ if key.startswith(normalized_base_path):
296
+ key = key[len(normalized_base_path):]
297
+ path_stripped = True
298
+ break
299
+ elif key.startswith(bp.rstrip("/")):
300
+ stripped_base = bp.rstrip("/")
301
+ if key.startswith(stripped_base + "/") or key == stripped_base:
302
+ key = key[len(stripped_base):]
303
+ key = key.lstrip("/")
304
+ path_stripped = True
305
+ break
306
+ elif base_path:
307
+ normalized_base_path = base_path.rstrip("/") + "/" if not base_path.endswith("/") else base_path
283
308
  if key.startswith(normalized_base_path):
284
309
  key = key[len(normalized_base_path):]
285
310
  path_stripped = True
286
- break
287
- elif key.startswith(bp.rstrip("/")):
288
- # Handle case where base_path matches exactly without trailing slash
289
- stripped_base = bp.rstrip("/")
311
+ elif key.startswith(base_path.rstrip("/")):
312
+ stripped_base = base_path.rstrip("/")
290
313
  if key.startswith(stripped_base + "/") or key == stripped_base:
291
314
  key = key[len(stripped_base):]
292
315
  key = key.lstrip("/")
293
316
  path_stripped = True
294
- break
295
-
296
- # If base_path is provided and no base_paths matched, use single base_path
297
- elif base_path:
298
- # Normalize base_path to ensure consistent handling of trailing slashes
299
- normalized_base_path = base_path.rstrip("/") + "/" if not base_path.endswith("/") else base_path
300
- if key.startswith(normalized_base_path):
301
- key = key[len(normalized_base_path):]
317
+
318
+ # If workspace is provided and no base paths matched, fall back to workspace logic
319
+ if not path_stripped and workspace and file_path.startswith(workspace):
320
+ key = file_path[len(workspace):]
321
+ # Remove all leading slashes (for absolute paths)
322
+ while key.startswith("/"):
323
+ key = key[1:]
302
324
  path_stripped = True
303
- elif key.startswith(base_path.rstrip("/")):
304
- # Handle case where base_path matches exactly without trailing slash
305
- stripped_base = base_path.rstrip("/")
306
- if key.startswith(stripped_base + "/") or key == stripped_base:
307
- key = key[len(stripped_base):]
308
- key = key.lstrip("/")
309
- path_stripped = True
310
-
311
- # If workspace is provided and no base paths matched, fall back to workspace logic
312
- if not path_stripped and workspace and file_path.startswith(workspace):
313
- key = file_path[len(workspace):]
314
- key = key.lstrip("/")
315
- key = key.lstrip("./")
316
- path_stripped = True
317
-
318
- # If no path stripping occurred, clean up the key
319
- if not path_stripped:
320
- # No base_path, base_paths, or workspace stripping occurred, clean up leading parts
321
- key = key.lstrip("/")
322
- key = key.lstrip("./")
323
325
 
324
- # Create lazy file loader instead of opening file immediately
325
- # Use the relative path (key) as filename instead of truncated basename
326
- lazy_file = LazyFileLoader(file_path, key)
327
- payload = (key, (key, lazy_file))
328
- send_files.append(payload)
326
+ # Clean up relative path prefixes, but preserve filename dots
327
+ while key.startswith("./"):
328
+ key = key[2:]
329
+ while key.startswith("../"):
330
+ key = key[3:]
331
+ # Remove any remaining leading slashes (for absolute paths)
332
+ while key.startswith("/"):
333
+ key = key[1:]
334
+
335
+ # Remove Windows drive letter if present (C:/...)
336
+ if len(key) > 2 and key[1] == ':' and (key[2] == '/' or key[2] == '\\'):
337
+ key = key[2:]
338
+ while key.startswith("/"):
339
+ key = key[1:]
329
340
 
330
- log.debug(f"Prepared {len(send_files)} files for lazy loading")
331
- return send_files
341
+ # Create lazy file loader instead of opening file immediately
342
+ lazy_file = LazyFileLoader(file_path, key)
343
+ payload = (key, (key, lazy_file))
344
+ send_files.append(payload)
345
+ return send_files
@@ -0,0 +1 @@
1
+ __version__ = "3.0.14"
@@ -1 +0,0 @@
1
- __version__ = "3.0.13"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes