socketsecurity 1.0.22__tar.gz → 1.0.24__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.22/socketsecurity.egg-info → socketsecurity-1.0.24}/PKG-INFO +1 -1
  2. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity/__init__.py +1 -1
  3. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity/core/__init__.py +16 -4
  4. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity/core/git_interface.py +2 -0
  5. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity/socketcli.py +8 -0
  6. {socketsecurity-1.0.22 → socketsecurity-1.0.24/socketsecurity.egg-info}/PKG-INFO +1 -1
  7. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/LICENSE +0 -0
  8. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/README.md +0 -0
  9. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/pyproject.toml +0 -0
  10. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/setup.cfg +0 -0
  11. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity/core/classes.py +0 -0
  12. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity/core/exceptions.py +0 -0
  13. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity/core/github.py +0 -0
  14. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity/core/gitlab.py +0 -0
  15. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity/core/issues.py +0 -0
  16. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity/core/licenses.py +0 -0
  17. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity/core/messages.py +0 -0
  18. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity/core/scm_comments.py +0 -0
  19. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity.egg-info/SOURCES.txt +0 -0
  20. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity.egg-info/dependency_links.txt +0 -0
  21. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity.egg-info/entry_points.txt +0 -0
  22. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/socketsecurity.egg-info/requires.txt +0 -0
  23. {socketsecurity-1.0.22 → socketsecurity-1.0.24}/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.22
3
+ Version: 1.0.24
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.22'
2
+ __version__ = '1.0.24'
@@ -45,9 +45,8 @@ org_id = None
45
45
  org_slug = None
46
46
  all_new_alerts = False
47
47
  security_policy = {}
48
+ allow_unverified_ssl = False
48
49
  log = logging.getLogger("socketdev")
49
- # log_format = "%(asctime)s %(funcName)20s() %(message)s"
50
- # logging.basicConfig(format=log_format)
51
50
  log.addHandler(logging.NullHandler())
52
51
 
53
52
  socket_globs = {
@@ -164,13 +163,17 @@ def do_request(
164
163
  'User-Agent': f'SocketPythonCLI/{__version__}',
165
164
  "accept": "application/json"
166
165
  }
166
+ verify = False
167
+ if allow_unverified_ssl:
168
+ verify = True
167
169
  response = requests.request(
168
170
  method.upper(),
169
171
  url,
170
172
  headers=headers,
171
173
  data=payload,
172
174
  files=files,
173
- timeout=timeout
175
+ timeout=timeout,
176
+ verify=verify
174
177
  )
175
178
  output_headers = headers.copy()
176
179
  output_headers['Authorization'] = "API_KEY_REDACTED"
@@ -215,7 +218,16 @@ class Core:
215
218
  request_timeout: int
216
219
  reports: list
217
220
 
218
- def __init__(self, token: str, base_api_url=None, request_timeout=None, enable_all_alerts=False):
221
+ def __init__(
222
+ self,
223
+ token: str,
224
+ base_api_url: str = None,
225
+ request_timeout: int = None,
226
+ enable_all_alerts: bool = False,
227
+ allow_unverified: bool = False
228
+ ):
229
+ global allow_unverified_ssl
230
+ allow_unverified_ssl = allow_unverified
219
231
  self.token = token + ":"
220
232
  encode_key(self.token)
221
233
  self.socket_date_format = "%Y-%m-%dT%H:%M:%S.%fZ"
@@ -1,5 +1,6 @@
1
1
  from git import Repo
2
2
  from socketsecurity.core import log
3
+ import urllib.parse
3
4
 
4
5
 
5
6
  class Git:
@@ -15,6 +16,7 @@ class Git:
15
16
  self.repo_name = self.repo.remotes.origin.url.split('.git')[0].split('/')[-1]
16
17
  try:
17
18
  self.branch = self.head.reference
19
+ urllib.parse.unquote(str(self.branch))
18
20
  except Exception as error:
19
21
  self.branch = None
20
22
  log.debug(error)
@@ -113,6 +113,13 @@ parser.add_argument(
113
113
  default=False
114
114
  )
115
115
 
116
+ parser.add_argument(
117
+ '--allow-unverified',
118
+ help='Allow unverified SSL Connections',
119
+ action='store_true',
120
+ default=False
121
+ )
122
+
116
123
  parser.add_argument(
117
124
  '--enable-json',
118
125
  help='Enable json output of results instead of table formatted',
@@ -235,6 +242,7 @@ def main_code():
235
242
  disable_security_issue = arguments.disable_security_issue
236
243
  ignore_commit_files = arguments.ignore_commit_files
237
244
  disable_blocking = arguments.disable_blocking
245
+ allow_unverified = arguments.allow_unverified
238
246
  if disable_blocking:
239
247
  global blocking_disabled
240
248
  blocking_disabled = True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 1.0.22
3
+ Version: 1.0.24
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