socketsecurity 0.0.88__tar.gz → 0.0.91__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-0.0.88/socketsecurity.egg-info → socketsecurity-0.0.91}/PKG-INFO +1 -1
  2. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity/__init__.py +1 -1
  3. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity/core/__init__.py +1 -1
  4. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity/core/github.py +2 -1
  5. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity/core/gitlab.py +6 -1
  6. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity/socketcli.py +14 -0
  7. {socketsecurity-0.0.88 → socketsecurity-0.0.91/socketsecurity.egg-info}/PKG-INFO +1 -1
  8. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/LICENSE +0 -0
  9. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/README.md +0 -0
  10. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/pyproject.toml +0 -0
  11. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/setup.cfg +0 -0
  12. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity/core/classes.py +0 -0
  13. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity/core/exceptions.py +0 -0
  14. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity/core/git_interface.py +0 -0
  15. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity/core/issues.py +0 -0
  16. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity/core/licenses.py +0 -0
  17. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity/core/messages.py +0 -0
  18. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity/core/scm_comments.py +0 -0
  19. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity.egg-info/SOURCES.txt +0 -0
  20. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity.egg-info/dependency_links.txt +0 -0
  21. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity.egg-info/entry_points.txt +0 -0
  22. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity.egg-info/requires.txt +0 -0
  23. {socketsecurity-0.0.88 → socketsecurity-0.0.91}/socketsecurity.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 0.0.88
3
+ Version: 0.0.91
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__ = '0.0.88'
2
+ __version__ = '0.0.91'
@@ -394,7 +394,7 @@ class Core:
394
394
  _, base_name = file.rsplit("/", 1)
395
395
  else:
396
396
  base_name = file
397
- if new_files is not None and base_name not in new_files:
397
+ if new_files is not None and len(new_files) > 0 and base_name not in new_files:
398
398
  continue
399
399
  if platform.system() == "Windows":
400
400
  file = file.replace("\\", "/")
@@ -104,7 +104,8 @@ def do_request(
104
104
  "status_code": response.status_code,
105
105
  "UnexpectedError": "There was an unexpected error using the API",
106
106
  "error": response.text,
107
- "payload": payload
107
+ "payload": payload,
108
+ "path": path
108
109
  }
109
110
  raise APIFailure(msg)
110
111
 
@@ -45,6 +45,9 @@ gitlab_variables = [
45
45
  for env in gitlab_variables:
46
46
  var_name = env.lower()
47
47
  globals()[var_name] = os.getenv(env) or None
48
+ if var_name != 'gitlab_token':
49
+ value = globals()[var_name]
50
+ log.debug(f"{env}={value}")
48
51
 
49
52
 
50
53
  def do_request(
@@ -94,7 +97,9 @@ def do_request(
94
97
  msg = {
95
98
  "status_code": response.status_code,
96
99
  "UnexpectedError": "There was an unexpected error using the API",
97
- "error": response.text
100
+ "error": response.text,
101
+ "payload": payload,
102
+ "path": path
98
103
  }
99
104
  raise APIFailure(msg)
100
105
 
@@ -248,23 +248,34 @@ def main_code():
248
248
  diff = None
249
249
  if scm is not None and scm.check_event_type() == "comment":
250
250
  log.info("Comment initiated flow")
251
+ log.debug(f"Getting comments for Repo {scm.repository} for PR {scm.pr_number}")
251
252
  comments = scm.get_comments_for_pr(scm.repository, str(scm.pr_number))
253
+ log.debug("Removing comment alerts")
252
254
  scm.remove_comment_alerts(comments)
253
255
  elif scm is not None and scm.check_event_type() != "comment":
254
256
  log.info("Push initiated flow")
255
257
  diff: Diff
256
258
  diff = core.create_new_diff(target_path, params, workspace=target_path, new_files=files)
257
259
  if scm.check_event_type() == "diff":
260
+ log.info("Starting comment logic for PR/MR event")
261
+ log.debug(f"Getting comments for Repo {scm.repository} for PR {scm.pr_number}")
258
262
  comments = scm.get_comments_for_pr(repo, str(pr_number))
263
+ log.debug("Removing comment alerts")
264
+ log.debug("")
259
265
  diff.new_alerts = Comments.remove_alerts(comments, diff.new_alerts)
266
+ log.debug("Creating Dependency Overview Comment")
260
267
  overview_comment = Messages.dependency_overview_template(diff)
268
+ log.debug("Creating Security Issues Comment")
261
269
  security_comment = Messages.security_comment_template(diff)
262
270
  new_security_comment = True
263
271
  new_overview_comment = True
264
272
  if len(diff.new_alerts) == 0 or disable_security_issue:
265
273
  new_security_comment = False
274
+ log.debug("No new alerts or security issue comment disabled")
266
275
  if (len(diff.new_packages) == 0 and diff.removed_packages == 0) or disable_overview:
267
276
  new_overview_comment = False
277
+ log.debug("No new/removed packages or Dependency Overview comment disabled")
278
+ log.debug(f"Adding comments for {scm_type}")
268
279
  scm.add_socket_comments(
269
280
  security_comment,
270
281
  overview_comment,
@@ -272,7 +283,10 @@ def main_code():
272
283
  new_security_comment,
273
284
  new_overview_comment
274
285
  )
286
+ else:
287
+ log.info("Not a PR/MR event no comment needed")
275
288
  if enable_json:
289
+ log.debug("Outputting JSON Results")
276
290
  output_console_json(diff)
277
291
  else:
278
292
  output_console_comments(diff)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 0.0.88
3
+ Version: 0.0.91
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