socketsecurity 1.0.21__tar.gz → 1.0.22__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 (23) hide show
  1. {socketsecurity-1.0.21/socketsecurity.egg-info → socketsecurity-1.0.22}/PKG-INFO +1 -1
  2. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity/__init__.py +1 -1
  3. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity/core/__init__.py +8 -0
  4. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity/core/classes.py +2 -0
  5. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity/core/messages.py +13 -0
  6. {socketsecurity-1.0.21 → socketsecurity-1.0.22/socketsecurity.egg-info}/PKG-INFO +1 -1
  7. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/LICENSE +0 -0
  8. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/README.md +0 -0
  9. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/pyproject.toml +0 -0
  10. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/setup.cfg +0 -0
  11. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity/core/exceptions.py +0 -0
  12. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity/core/git_interface.py +0 -0
  13. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity/core/github.py +0 -0
  14. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity/core/gitlab.py +0 -0
  15. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity/core/issues.py +0 -0
  16. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity/core/licenses.py +0 -0
  17. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity/core/scm_comments.py +0 -0
  18. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity/socketcli.py +0 -0
  19. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity.egg-info/SOURCES.txt +0 -0
  20. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity.egg-info/dependency_links.txt +0 -0
  21. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity.egg-info/entry_points.txt +0 -0
  22. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity.egg-info/requires.txt +0 -0
  23. {socketsecurity-1.0.21 → socketsecurity-1.0.22}/socketsecurity.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 1.0.21
3
+ Version: 1.0.22
4
4
  Summary: Socket Security CLI for CI/CD
5
5
  Author-email: Douglas Coburn <douglas@socket.dev>
6
6
  Maintainer-email: Douglas Coburn <douglas@socket.dev>
@@ -1,2 +1,2 @@
1
1
  __author__ = 'socket.dev'
2
- __version__ = '1.0.21'
2
+ __version__ = '1.0.22'
@@ -547,6 +547,7 @@ class Core:
547
547
  total_head_time = head_end - head_start
548
548
  log.info(f"Total time to get head full-scan {total_head_time: .2f}")
549
549
  except APIResourceNotFound:
550
+ head_full_scan_id = None
550
551
  head_full_scan = []
551
552
  new_scan_start = time.time()
552
553
  new_full_scan = Core.create_full_scan(files, params, workspace)
@@ -556,7 +557,14 @@ class Core:
556
557
  log.info(f"Total time to get new full-scan {total_new_time: .2f}")
557
558
  diff_report = Core.compare_sboms(new_full_scan.sbom_artifacts, head_full_scan)
558
559
  diff_report.packages = new_full_scan.packages
560
+ # Set the diff ID and URLs
561
+ base_socket = "https://socket.dev/dashboard/org"
559
562
  diff_report.id = new_full_scan.id
563
+ diff_report.report_url = f"{base_socket}/{org_slug}/sbom/{diff_report.id}"
564
+ if head_full_scan_id is not None:
565
+ diff_report.diff_url = f"{base_socket}/{org_slug}/diff/{diff_report.id}/{head_full_scan_id}"
566
+ else:
567
+ diff_report.diff_url = diff_report.report_url
560
568
  return diff_report
561
569
 
562
570
  @staticmethod
@@ -312,6 +312,8 @@ class Diff:
312
312
  id: str
313
313
  sbom: str
314
314
  packages: dict
315
+ report_url: str
316
+ diff_url: str
315
317
 
316
318
  def __init__(self, **kwargs):
317
319
  if kwargs:
@@ -189,8 +189,21 @@ class Messages:
189
189
  if len(diff.removed_packages) > 0:
190
190
  md = Messages.create_remove_line(diff, md)
191
191
  md.create_md_file()
192
+ if len(md.file_data_text.lstrip()) >= 65500:
193
+ md = Messages.short_dependency_overview_comment(diff)
192
194
  return md.file_data_text.lstrip()
193
195
 
196
+ @staticmethod
197
+ def short_dependency_overview_comment(diff: Diff) -> MdUtils:
198
+ md = MdUtils(file_name="markdown_overview_temp.md")
199
+ md.new_line("<!-- socket-overview-comment-actions -->")
200
+ md.new_header(level=1, title="Socket Security: Dependency Overview")
201
+ md.new_line("New and removed dependencies detected. Learn more about [socket.dev](https://socket.dev)")
202
+ md.new_line()
203
+ md.new_line("The amount of dependency changes were to long for this comment. Please check out the full report")
204
+ md.new_line(f"To view more information about this report checkout the [Full Report]({diff.diff_url})")
205
+ return md
206
+
194
207
  @staticmethod
195
208
  def create_remove_line(diff: Diff, md: MdUtils) -> MdUtils:
196
209
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 1.0.21
3
+ Version: 1.0.22
4
4
  Summary: Socket Security CLI for CI/CD
5
5
  Author-email: Douglas Coburn <douglas@socket.dev>
6
6
  Maintainer-email: Douglas Coburn <douglas@socket.dev>
File without changes