socketsecurity 0.0.63__tar.gz → 0.0.65__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 (20) hide show
  1. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/PKG-INFO +1 -1
  2. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/pyproject.toml +1 -1
  3. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity/core/__init__.py +8 -3
  4. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity/core/exceptions.py +8 -1
  5. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity/core/gitlab.py +3 -3
  6. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity.egg-info/PKG-INFO +1 -1
  7. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/README.md +0 -0
  8. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/setup.cfg +0 -0
  9. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity/__init__.py +0 -0
  10. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity/core/classes.py +0 -0
  11. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity/core/github.py +0 -0
  12. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity/core/issues.py +0 -0
  13. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity/core/licenses.py +0 -0
  14. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity/core/messages.py +0 -0
  15. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity/socketcli.py +0 -0
  16. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity.egg-info/SOURCES.txt +0 -0
  17. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity.egg-info/dependency_links.txt +0 -0
  18. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity.egg-info/entry_points.txt +0 -0
  19. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/socketsecurity.egg-info/requires.txt +0 -0
  20. {socketsecurity-0.0.63 → socketsecurity-0.0.65}/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.63
3
+ Version: 0.0.65
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>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "socketsecurity"
7
- version = "0.0.63"
7
+ version = "0.0.65"
8
8
  requires-python = ">= 3.9"
9
9
  dependencies = [
10
10
  'requests',
@@ -3,7 +3,9 @@ import requests
3
3
  from urllib.parse import urlencode
4
4
  import base64
5
5
  import json
6
- from socketsecurity.core.exceptions import APIFailure, APIKeyMissing, APIAccessDenied, APIInsufficientQuota, APIResourceNotFound
6
+ from socketsecurity.core.exceptions import (
7
+ APIFailure, APIKeyMissing, APIAccessDenied, APIInsufficientQuota, APIResourceNotFound, APICloudflareError
8
+ )
7
9
  from socketsecurity.core.licenses import Licenses
8
10
  from socketsecurity.core.issues import AllIssues
9
11
  from socketsecurity.core.classes import (
@@ -23,7 +25,7 @@ import time
23
25
 
24
26
 
25
27
  __author__ = 'socket.dev'
26
- __version__ = '0.0.63'
28
+ __version__ = '0.0.65'
27
29
  __all__ = [
28
30
  "Core",
29
31
  "log",
@@ -110,9 +112,12 @@ def do_request(
110
112
  raise APIResourceNotFound(f"Path not found {path}")
111
113
  elif response.status_code == 429:
112
114
  raise APIInsufficientQuota("Insufficient quota for API route")
115
+ elif response.status_code == 524:
116
+ raise APICloudflareError
113
117
  else:
114
118
  msg = {
115
- "status_code": 524,
119
+ "status_code": response.status_code,
120
+ "error": response.text,
116
121
  "UnexpectedError": "There was an unexpected error using the API"
117
122
  }
118
123
  raise APIFailure(msg)
@@ -3,12 +3,19 @@ __all__ = [
3
3
  "APIKeyMissing",
4
4
  "APIAccessDenied",
5
5
  "APIInsufficientQuota",
6
- "APIResourceNotFound"
6
+ "APIResourceNotFound",
7
+ "APICloudflareError"
7
8
  ]
8
9
 
9
10
 
11
+ class APICloudflareError(Exception):
12
+ """Raised when there is an error using the API related to cloudflare"""
13
+ pass
14
+
15
+
10
16
  class APIKeyMissing(Exception):
11
17
  """Raised when the api key is not passed and the headers are empty"""
18
+ pass
12
19
 
13
20
 
14
21
  class APIFailure(Exception):
@@ -179,7 +179,7 @@ class Gitlab:
179
179
  payload = {
180
180
  "body": body
181
181
  }
182
- payload = json.dumps(payload)
182
+ # payload = json.dumps(payload)
183
183
  do_request(path, payload=payload, method="POST")
184
184
 
185
185
  @staticmethod
@@ -188,8 +188,8 @@ class Gitlab:
188
188
  payload = {
189
189
  "body": body
190
190
  }
191
- payload = json.dumps(payload)
192
- do_request(path, payload=payload, method="PATCH")
191
+ # payload = json.dumps(payload)
192
+ do_request(path, payload=payload, method="PUT")
193
193
 
194
194
  @staticmethod
195
195
  def get_comments_for_pr(repo: str, pr: str) -> dict:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 0.0.63
3
+ Version: 0.0.65
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>