socketsecurity 0.0.89__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.
- {socketsecurity-0.0.89/socketsecurity.egg-info → socketsecurity-0.0.91}/PKG-INFO +1 -1
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity/__init__.py +1 -1
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity/core/github.py +2 -1
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity/core/gitlab.py +6 -1
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity/socketcli.py +14 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91/socketsecurity.egg-info}/PKG-INFO +1 -1
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/LICENSE +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/README.md +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/pyproject.toml +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/setup.cfg +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity/core/__init__.py +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity/core/git_interface.py +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity/core/issues.py +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity/core/licenses.py +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity.egg-info/SOURCES.txt +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity.egg-info/dependency_links.txt +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity.egg-info/entry_points.txt +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity.egg-info/requires.txt +0 -0
- {socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity.egg-info/top_level.txt +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__author__ = 'socket.dev'
|
|
2
|
-
__version__ = '0.0.
|
|
2
|
+
__version__ = '0.0.91'
|
|
@@ -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)
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-0.0.89 → socketsecurity-0.0.91}/socketsecurity.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|