socketsecurity 2.2.11__tar.gz → 2.2.15__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 (86) hide show
  1. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/.github/workflows/pr-preview.yml +8 -8
  2. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/.github/workflows/release.yml +7 -7
  3. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/.github/workflows/version-check.yml +2 -2
  4. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/PKG-INFO +1 -1
  5. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/pyproject.toml +1 -1
  6. socketsecurity-2.2.15/socketsecurity/__init__.py +3 -0
  7. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/__init__.py +2 -1
  8. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/cli_client.py +2 -1
  9. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/resource_utils.py +21 -8
  10. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/scm/client.py +3 -2
  11. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/scm/github.py +2 -1
  12. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/scm/gitlab.py +8 -7
  13. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/socketcli.py +1 -1
  14. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/unit/test_gitlab_auth.py +2 -1
  15. socketsecurity-2.2.11/Pipfile.lock +0 -20
  16. socketsecurity-2.2.11/socketsecurity/__init__.py +0 -2
  17. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/.github/CODEOWNERS +0 -0
  18. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
  19. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
  20. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
  21. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  22. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/.github/workflows/docker-stable.yml +0 -0
  23. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/.gitignore +0 -0
  24. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/.hooks/sync_version.py +0 -0
  25. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/.pre-commit-config.yaml +0 -0
  26. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/.python-version +0 -0
  27. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/Dockerfile +0 -0
  28. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/LICENSE +0 -0
  29. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/Makefile +0 -0
  30. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/README.md +0 -0
  31. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/docs/README.md +0 -0
  32. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/pytest.ini +0 -0
  33. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/scripts/build_container.sh +0 -0
  34. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/scripts/deploy-test-docker.sh +0 -0
  35. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/scripts/deploy-test-pypi.sh +0 -0
  36. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/scripts/run.sh +0 -0
  37. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/config.py +0 -0
  38. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/classes.py +0 -0
  39. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/exceptions.py +0 -0
  40. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/git_interface.py +0 -0
  41. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/helper/__init__.py +0 -0
  42. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/lazy_file_loader.py +0 -0
  43. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/logging.py +0 -0
  44. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/messages.py +0 -0
  45. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/scm/__init__.py +0 -0
  46. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/scm/base.py +0 -0
  47. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/scm_comments.py +0 -0
  48. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/socket_config.py +0 -0
  49. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/core/utils.py +0 -0
  50. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/output.py +0 -0
  51. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/plugins/__init__.py +0 -0
  52. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/plugins/base.py +0 -0
  53. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/plugins/jira.py +0 -0
  54. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/plugins/manager.py +0 -0
  55. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/plugins/slack.py +0 -0
  56. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/plugins/teams.py +0 -0
  57. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/socketsecurity/plugins/webhook.py +0 -0
  58. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/__init__.py +0 -0
  59. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/core/conftest.py +0 -0
  60. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/core/create_diff_input.json +0 -0
  61. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/core/test_diff_generation.py +0 -0
  62. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/core/test_package_and_alerts.py +0 -0
  63. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/core/test_sdk_methods.py +0 -0
  64. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/core/test_supporting_methods.py +0 -0
  65. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/data/fullscans/create_response.json +0 -0
  66. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/data/fullscans/diff/stream_diff.json +0 -0
  67. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
  68. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/data/fullscans/head_scan/metadata.json +0 -0
  69. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
  70. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
  71. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/data/fullscans/new_scan/metadata.json +0 -0
  72. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
  73. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/data/repos/repo_info_error.json +0 -0
  74. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/data/repos/repo_info_no_head.json +0 -0
  75. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/data/repos/repo_info_success.json +0 -0
  76. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/data/settings/security-policy.json +0 -0
  77. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/unit/__init__.py +0 -0
  78. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/unit/test_cli_config.py +0 -0
  79. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/unit/test_client.py +0 -0
  80. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/unit/test_config.py +0 -0
  81. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/unit/test_gitlab_auth_fallback.py +0 -0
  82. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/tests/unit/test_output.py +0 -0
  83. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/uv.lock +0 -0
  84. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/workflows/bitbucket-pipelines.yml +0 -0
  85. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/workflows/github-actions.yml +0 -0
  86. {socketsecurity-2.2.11 → socketsecurity-2.2.15}/workflows/gitlab-ci.yml +0 -0
@@ -11,10 +11,10 @@ jobs:
11
11
  contents: read
12
12
  pull-requests: write
13
13
  steps:
14
- - uses: actions/checkout@v4
14
+ - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
15
15
  with:
16
16
  fetch-depth: 0
17
- - uses: actions/setup-python@v5
17
+ - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
18
18
  with:
19
19
  python-version: '3.x'
20
20
 
@@ -43,14 +43,14 @@ jobs:
43
43
 
44
44
  - name: Publish to Test PyPI
45
45
  if: steps.version_check.outputs.exists != 'true'
46
- uses: pypa/gh-action-pypi-publish@v1.12.4
46
+ uses: pypa/gh-action-pypi-publish@ab69e431e9c9f48a3310be0a56527c679f56e04d
47
47
  with:
48
48
  repository-url: https://test.pypi.org/legacy/
49
49
  verbose: true
50
50
 
51
51
  - name: Comment on PR
52
52
  if: steps.version_check.outputs.exists != 'true'
53
- uses: actions/github-script@v7
53
+ uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
54
54
  env:
55
55
  VERSION: ${{ env.VERSION }}
56
56
  with:
@@ -120,21 +120,21 @@ jobs:
120
120
  exit 1
121
121
 
122
122
  - name: Set up QEMU
123
- uses: docker/setup-qemu-action@v3
123
+ uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
124
124
 
125
125
  - name: Set up Docker Buildx
126
- uses: docker/setup-buildx-action@v3
126
+ uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349
127
127
 
128
128
  - name: Login to Docker Hub with Organization Token
129
129
  if: steps.verify_package.outputs.success == 'true'
130
- uses: docker/login-action@v3
130
+ uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
131
131
  with:
132
132
  username: ${{ secrets.DOCKERHUB_USERNAME }}
133
133
  password: ${{ secrets.DOCKERHUB_TOKEN }}
134
134
 
135
135
  - name: Build & Push Docker Preview
136
136
  if: steps.verify_package.outputs.success == 'true'
137
- uses: docker/build-push-action@v5
137
+ uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
138
138
  env:
139
139
  VERSION: ${{ env.VERSION }}
140
140
  with:
@@ -10,10 +10,10 @@ jobs:
10
10
  id-token: write
11
11
  contents: read
12
12
  steps:
13
- - uses: actions/checkout@v4
13
+ - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
14
14
  with:
15
15
  fetch-depth: 0
16
- - uses: actions/setup-python@v5
16
+ - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
17
17
  with:
18
18
  python-version: '3.x'
19
19
 
@@ -66,16 +66,16 @@ jobs:
66
66
 
67
67
  - name: Publish to PyPI
68
68
  if: steps.version_check.outputs.pypi_exists != 'true'
69
- uses: pypa/gh-action-pypi-publish@v1.12.4
69
+ uses: pypa/gh-action-pypi-publish@ab69e431e9c9f48a3310be0a56527c679f56e04d
70
70
 
71
71
  - name: Set up QEMU
72
- uses: docker/setup-qemu-action@v3
72
+ uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
73
73
 
74
74
  - name: Set up Docker Buildx
75
- uses: docker/setup-buildx-action@v3
75
+ uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349
76
76
 
77
77
  - name: Login to Docker Hub with Organization Token
78
- uses: docker/login-action@v3
78
+ uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
79
79
  with:
80
80
  username: ${{ secrets.DOCKERHUB_USERNAME }}
81
81
  password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -102,7 +102,7 @@ jobs:
102
102
  if: |
103
103
  steps.verify_package.outputs.success == 'true' &&
104
104
  steps.docker_check.outputs.docker_exists != 'true'
105
- uses: docker/build-push-action@v5
105
+ uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
106
106
  env:
107
107
  VERSION: ${{ env.VERSION }}
108
108
  with:
@@ -11,7 +11,7 @@ jobs:
11
11
  check_version:
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - uses: actions/checkout@v4
14
+ - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
15
15
  with:
16
16
  fetch-depth: 0 # Fetch all history for all branches
17
17
 
@@ -39,7 +39,7 @@ jobs:
39
39
  "
40
40
 
41
41
  - name: Manage PR Comment
42
- uses: actions/github-script@v7
42
+ uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
43
43
  if: always()
44
44
  env:
45
45
  MAIN_VERSION: ${{ env.MAIN_VERSION }}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: socketsecurity
3
- Version: 2.2.11
3
+ Version: 2.2.15
4
4
  Summary: Socket Security CLI for CI/CD
5
5
  Project-URL: Homepage, https://socket.dev
6
6
  Author-email: Douglas Coburn <douglas@socket.dev>
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "socketsecurity"
9
- version = "2.2.11"
9
+ version = "2.2.15"
10
10
  requires-python = ">= 3.10"
11
11
  license = {"file" = "LICENSE"}
12
12
  dependencies = [
@@ -0,0 +1,3 @@
1
+ __author__ = 'socket.dev'
2
+ __version__ = '2.2.15'
3
+ USER_AGENT = f'SocketPythonCLI/{__version__}'
@@ -18,7 +18,7 @@ from socketdev.org import Organization
18
18
  from socketdev.repos import RepositoryInfo
19
19
  from socketdev.settings import SecurityPolicyRule
20
20
  import copy
21
- from socketsecurity import __version__
21
+ from socketsecurity import __version__, USER_AGENT
22
22
  from socketsecurity.core.classes import (
23
23
  Alert,
24
24
  Diff,
@@ -39,6 +39,7 @@ __all__ = [
39
39
  "Core",
40
40
  "log",
41
41
  "__version__",
42
+ "USER_AGENT",
42
43
  ]
43
44
 
44
45
  version = __version__
@@ -4,6 +4,7 @@ from typing import Dict, List, Optional, Union
4
4
 
5
5
  import requests
6
6
 
7
+ from socketsecurity import USER_AGENT
7
8
  from .exceptions import APIFailure
8
9
  from .socket_config import SocketConfig
9
10
 
@@ -31,7 +32,7 @@ class CliClient:
31
32
 
32
33
  default_headers = {
33
34
  'Authorization': f"Basic {self._encoded_key}",
34
- 'User-Agent': 'SocketPythonCLI/0.0.1',
35
+ 'User-Agent': USER_AGENT,
35
36
  "accept": "application/json"
36
37
  }
37
38
 
@@ -1,8 +1,17 @@
1
1
  """
2
2
  System resource utilities for the Socket Security CLI.
3
3
  """
4
- import resource
5
4
  import logging
5
+ import sys
6
+
7
+ # The resource module is only available on Unix-like systems
8
+ resource_available = False
9
+ try:
10
+ import resource
11
+ resource_available = True
12
+ except ImportError:
13
+ # On Windows, the resource module is not available
14
+ pass
6
15
 
7
16
  log = logging.getLogger("socketdev")
8
17
 
@@ -10,10 +19,14 @@ log = logging.getLogger("socketdev")
10
19
  def get_file_descriptor_limit():
11
20
  """
12
21
  Get the current file descriptor limit (equivalent to ulimit -n)
13
-
22
+
14
23
  Returns:
15
- tuple: (soft_limit, hard_limit) or (None, None) if error
24
+ tuple: (soft_limit, hard_limit) or (None, None) if error or on Windows
16
25
  """
26
+ if not resource_available:
27
+ # On Windows, resource module is not available
28
+ return None, None
29
+
17
30
  try:
18
31
  soft_limit, hard_limit = resource.getrlimit(resource.RLIMIT_NOFILE)
19
32
  return soft_limit, hard_limit
@@ -25,26 +38,26 @@ def get_file_descriptor_limit():
25
38
  def check_file_count_against_ulimit(file_count, buffer_size=100):
26
39
  """
27
40
  Check if the number of files would exceed the file descriptor limit
28
-
41
+
29
42
  Args:
30
43
  file_count (int): Number of files to check
31
44
  buffer_size (int): Safety buffer to leave for other file operations
32
-
45
+
33
46
  Returns:
34
47
  dict: Information about the check
35
48
  """
36
49
  soft_limit, hard_limit = get_file_descriptor_limit()
37
-
50
+
38
51
  if soft_limit is None:
39
52
  return {
40
53
  "can_check": False,
41
54
  "error": "Could not determine file descriptor limit",
42
55
  "safe_to_process": True # Assume safe if we can't check
43
56
  }
44
-
57
+
45
58
  available_fds = soft_limit - buffer_size
46
59
  would_exceed = file_count > available_fds
47
-
60
+
48
61
  return {
49
62
  "can_check": True,
50
63
  "file_count": file_count,
@@ -1,6 +1,7 @@
1
1
  from abc import abstractmethod
2
2
  from typing import Dict
3
3
 
4
+ from socketsecurity import USER_AGENT
4
5
  from ..cli_client import CliClient
5
6
 
6
7
 
@@ -28,7 +29,7 @@ class GithubClient(ScmClient):
28
29
  def get_headers(self) -> Dict:
29
30
  return {
30
31
  'Authorization': f"Bearer {self.token}",
31
- 'User-Agent': 'SocketPythonScript/0.0.1',
32
+ 'User-Agent': USER_AGENT,
32
33
  "accept": "application/json"
33
34
  }
34
35
 
@@ -52,7 +53,7 @@ class GitlabClient(ScmClient):
52
53
  import os
53
54
 
54
55
  base_headers = {
55
- 'User-Agent': 'SocketPythonScript/0.0.1',
56
+ 'User-Agent': USER_AGENT,
56
57
  "accept": "application/json"
57
58
  }
58
59
 
@@ -5,6 +5,7 @@ from dataclasses import dataclass
5
5
 
6
6
  from git import Optional
7
7
 
8
+ from socketsecurity import USER_AGENT
8
9
  from socketsecurity.core import log
9
10
  from socketsecurity.core.classes import Comment
10
11
  from socketsecurity.core.scm_comments import Comments
@@ -83,7 +84,7 @@ class GithubConfig:
83
84
  event_action=event_action,
84
85
  headers={
85
86
  'Authorization': f"Bearer {token}",
86
- 'User-Agent': 'SocketPythonScript/0.0.1',
87
+ 'User-Agent': USER_AGENT,
87
88
  "accept": "application/json"
88
89
  }
89
90
  )
@@ -3,6 +3,7 @@ import sys
3
3
  from dataclasses import dataclass
4
4
  from typing import Optional
5
5
 
6
+ from socketsecurity import USER_AGENT
6
7
  from socketsecurity.core import log
7
8
  from socketsecurity.core.classes import Comment
8
9
  from socketsecurity.core.scm_comments import Comments
@@ -79,7 +80,7 @@ class GitlabConfig:
79
80
  - Other tokens: Use PRIVATE-TOKEN as fallback
80
81
  """
81
82
  base_headers = {
82
- 'User-Agent': 'SocketPythonScript/0.0.1',
83
+ 'User-Agent': USER_AGENT,
83
84
  "accept": "application/json"
84
85
  }
85
86
 
@@ -150,7 +151,7 @@ class Gitlab:
150
151
  If using Bearer, fallback to PRIVATE-TOKEN and vice versa.
151
152
  """
152
153
  base_headers = {
153
- 'User-Agent': 'SocketPythonScript/0.0.1',
154
+ 'User-Agent': USER_AGENT,
154
155
  "accept": "application/json"
155
156
  }
156
157
 
@@ -171,11 +172,11 @@ class Gitlab:
171
172
  }
172
173
 
173
174
  # No fallback available
174
- return None
175
+ return {}
175
176
 
176
177
  def check_event_type(self) -> str:
177
178
  pipeline_source = self.config.pipeline_source.lower()
178
- if pipeline_source in ["web", 'merge_request_event', "push", "api"]:
179
+ if pipeline_source in ["web", 'merge_request_event', "push", "api", 'pipeline']:
179
180
  if not self.config.mr_iid:
180
181
  return "main"
181
182
  return "diff"
@@ -234,8 +235,8 @@ class Gitlab:
234
235
  new_security_comment: bool = True,
235
236
  new_overview_comment: bool = True
236
237
  ) -> None:
237
- existing_overview_comment = comments.get("overview")
238
- existing_security_comment = comments.get("security")
238
+ existing_overview_comment = comments.get("overview", "")
239
+ existing_security_comment = comments.get("security", "")
239
240
  if new_overview_comment:
240
241
  log.debug("New Dependency Overview comment")
241
242
  if existing_overview_comment is not None:
@@ -256,7 +257,7 @@ class Gitlab:
256
257
  self.post_comment(security_comment)
257
258
 
258
259
  def remove_comment_alerts(self, comments: dict):
259
- security_alert = comments.get("security")
260
+ security_alert = comments.get("security", "")
260
261
  if security_alert is not None:
261
262
  security_alert: Comment
262
263
  new_body = Comments.process_security_comment(security_alert, comments)
@@ -114,7 +114,7 @@ def main_code():
114
114
 
115
115
  # Git setup
116
116
  is_repo = False
117
- git_repo = None
117
+ git_repo: Git
118
118
  try:
119
119
  git_repo = Git(config.target_path)
120
120
  is_repo = True
@@ -3,6 +3,7 @@ import os
3
3
  import pytest
4
4
  from unittest.mock import patch, MagicMock
5
5
 
6
+ from socketsecurity import USER_AGENT
6
7
  from socketsecurity.core.scm.gitlab import GitlabConfig
7
8
 
8
9
 
@@ -58,7 +59,7 @@ class TestGitlabAuthHeaders:
58
59
 
59
60
  for token in test_tokens:
60
61
  headers = GitlabConfig._get_auth_headers(token)
61
- assert headers['User-Agent'] == 'SocketPythonScript/0.0.1'
62
+ assert headers['User-Agent'] == USER_AGENT
62
63
  assert headers['accept'] == 'application/json'
63
64
 
64
65
  @patch.dict(os.environ, {'CI_JOB_TOKEN': 'ci-token-123'})
@@ -1,20 +0,0 @@
1
- {
2
- "_meta": {
3
- "hash": {
4
- "sha256": "7e8ad3d0508bf0c279a648ee7a1873fc16334cf0b711f30b2dc54a1da68fef6c"
5
- },
6
- "pipfile-spec": 6,
7
- "requires": {
8
- "python_version": "3.12"
9
- },
10
- "sources": [
11
- {
12
- "name": "pypi",
13
- "url": "https://pypi.org/socketsecurity",
14
- "verify_ssl": true
15
- }
16
- ]
17
- },
18
- "default": {},
19
- "develop": {}
20
- }
@@ -1,2 +0,0 @@
1
- __author__ = 'socket.dev'
2
- __version__ = '2.2.11'
File without changes
File without changes