socketsecurity 0.0.57__tar.gz → 0.0.59__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 (21) hide show
  1. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/PKG-INFO +1 -1
  2. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/pyproject.toml +1 -1
  3. socketsecurity-0.0.59/socketsecurity/__init__.py +4 -0
  4. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity/core/__init__.py +1 -1
  5. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity/core/glitlab.py +5 -5
  6. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity/core/issues.py +26 -4
  7. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity/socketcli.py +3 -8
  8. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity.egg-info/PKG-INFO +1 -1
  9. socketsecurity-0.0.57/socketsecurity/__init__.py +0 -2
  10. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/README.md +0 -0
  11. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/setup.cfg +0 -0
  12. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity/core/classes.py +0 -0
  13. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity/core/exceptions.py +0 -0
  14. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity/core/github.py +0 -0
  15. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity/core/licenses.py +0 -0
  16. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity/core/messages.py +0 -0
  17. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity.egg-info/SOURCES.txt +0 -0
  18. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity.egg-info/dependency_links.txt +0 -0
  19. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity.egg-info/entry_points.txt +0 -0
  20. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/socketsecurity.egg-info/requires.txt +0 -0
  21. {socketsecurity-0.0.57 → socketsecurity-0.0.59}/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.57
3
+ Version: 0.0.59
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.57"
7
+ version = "0.0.59"
8
8
  requires-python = ">= 3.9"
9
9
  dependencies = [
10
10
  'requests',
@@ -0,0 +1,4 @@
1
+ import socketsecurity.core
2
+
3
+ __author__ = 'socket.dev'
4
+ __version = socketsecurity.core.__version__
@@ -23,7 +23,7 @@ import time
23
23
 
24
24
 
25
25
  __author__ = 'socket.dev'
26
- __version__ = '0.0.57'
26
+ __version__ = '0.0.59'
27
27
  __all__ = [
28
28
  "Core",
29
29
  "log",
@@ -10,7 +10,7 @@ import sys
10
10
  global ci_commit_sha
11
11
  global ci_api_v4_url
12
12
  global ci_project_dir
13
- global ci_commit_branch
13
+ global ci_merge_request_source_branch_name
14
14
  global ci_merge_request_iid
15
15
  global ci_merge_request_project_id
16
16
  global ci_commit_message
@@ -30,7 +30,7 @@ gitlab_variables = [
30
30
  "CI_COMMIT_SHA",
31
31
  "CI_API_V4_URL",
32
32
  "CI_PROJECT_DIR",
33
- "CI_COMMIT_BRANCH",
33
+ "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME",
34
34
  "CI_MERGE_REQUEST_IID",
35
35
  "CI_MERGE_REQUEST_PROJECT_ID",
36
36
  "CI_COMMIT_MESSAGE",
@@ -124,11 +124,11 @@ class Gitlab:
124
124
  self.api_url = ci_api_v4_url
125
125
  self.ref_type = ""
126
126
  self.event_name = ci_pipeline_source
127
- self.workspace = project_dir
127
+ self.workspace = ci_project_dir
128
128
  self.repository = ci_project_name
129
129
  if "/" in self.repository:
130
130
  self.repository = self.repository.rsplit("/")[1]
131
- self.branch = ci_commit_branch
131
+ self.branch = ci_merge_request_source_branch_name
132
132
  self.default_branch = ci_default_branch
133
133
  if self.branch == self.default_branch:
134
134
  self.is_default_branch = True
@@ -146,7 +146,7 @@ class Gitlab:
146
146
 
147
147
  @staticmethod
148
148
  def check_event_type() -> str:
149
- if ci_pipeline_source.lower() == "push":
149
+ if ci_pipeline_source.lower() == "push" or ci_pipeline_source.lower == 'merge_request_event':
150
150
  if ci_merge_request_iid is None or ci_merge_request_iid == "":
151
151
  event_type = "main"
152
152
  else:
@@ -55,6 +55,7 @@ __all__ = [
55
55
  "missingDependency",
56
56
  "missingLicense",
57
57
  "mixedLicense",
58
+ "ambiguousClassifier",
58
59
  "modifiedException",
59
60
  "modifiedLicense",
60
61
  "networkAccess",
@@ -382,7 +383,7 @@ class copyleftLicense:
382
383
 
383
384
  def __init__(self):
384
385
  self.description = "(Experimental) Copyleft license information was found"
385
- self.props = {"comments": "Comments", "exceptionId": "Exception id", "licenseId": "License Identifier"}
386
+ self.props = {"comments": "Comments", "licenseId": "License Identifiers"}
386
387
  self.suggestion = "Determine whether use of copyleft material works for you"
387
388
  self.title = "Copyleft License"
388
389
  self.emoji = "\u26a0\ufe0f"
@@ -402,7 +403,7 @@ class nonpermissiveLicense:
402
403
 
403
404
  def __init__(self):
404
405
  self.description = "(Experimental) A license not known to be considered permissive was found"
405
- self.props = {"comments": "Comments", "exceptionId": "Exception id", "licenseId": "License Identifier"}
406
+ self.props = {"comments": "Comments", "licenseId": "License Identifier"}
406
407
  self.suggestion = "Determine whether use of material not offered under a known permissive license works for you"
407
408
  self.title = "Non-permissive License"
408
409
  self.emoji = "\u26a0\ufe0f"
@@ -1106,7 +1107,7 @@ class mixedLicense:
1106
1107
 
1107
1108
  def __init__(self):
1108
1109
  self.description = "(Experimental) Package contains multiple licenses."
1109
- self.props = {"licenseId": "License Id"}
1110
+ self.props = {"licenseId": "License Ids"}
1110
1111
  self.suggestion = "A new version of the package should be published that includes a single license. Consumers may seek clarification from the package author. Ensure that the license details are consistent across the LICENSE file, package.json license field and license details mentioned in the README."
1111
1112
  self.title = "Mixed license"
1112
1113
  self.emoji = "\u26a0\ufe0f"
@@ -1116,6 +1117,26 @@ class mixedLicense:
1116
1117
  return json.dumps(self.__dict__)
1117
1118
 
1118
1119
 
1120
+ class ambiguousClassifier:
1121
+ props: dict
1122
+ description: str
1123
+ suggestion: str
1124
+ title: str
1125
+ emoji: str
1126
+ nextStepTitle: str
1127
+
1128
+ def __init__(self):
1129
+ self.props = {"classifier": "The classifier"}
1130
+ self.description = "(Experimental) An ambiguous license classifier was found."
1131
+ self.suggestion = "A specific license or licenses should be identified"
1132
+ self.title = "Ambiguous License Classifier"
1133
+ self.emoji = "\u26a0\ufe0f"
1134
+ self.nextStepTitle = "What is an ambiguous license classifier?"
1135
+
1136
+ def __str__(self):
1137
+ return json.dumps(self.__dict__)
1138
+
1139
+
1119
1140
  class modifiedException:
1120
1141
  description: str
1121
1142
  props: dict
@@ -1943,6 +1964,7 @@ class AllIssues:
1943
1964
  missingDependency: missingDependency
1944
1965
  missingLicense: missingLicense
1945
1966
  mixedLicense: mixedLicense
1967
+ ambiguousClassifier: ambiguousClassifier
1946
1968
  modifiedException: modifiedException
1947
1969
  modifiedLicense: modifiedLicense
1948
1970
  networkAccess: networkAccess
@@ -1983,7 +2005,6 @@ class AllIssues:
1983
2005
  zeroWidth: zeroWidth
1984
2006
  floatingDependency: floatingDependency
1985
2007
  unpopularPackage: unpopularPackage
1986
-
1987
2008
  def __init__(self):
1988
2009
  self.badEncoding = badEncoding()
1989
2010
  self.badSemver = badSemver()
@@ -2037,6 +2058,7 @@ class AllIssues:
2037
2058
  self.missingDependency = missingDependency()
2038
2059
  self.missingLicense = missingLicense()
2039
2060
  self.mixedLicense = mixedLicense()
2061
+ self.ambiguousClassifier = ambiguousClassifier()
2040
2062
  self.modifiedException = modifiedException()
2041
2063
  self.modifiedLicense = modifiedLicense()
2042
2064
  self.networkAccess = networkAccess()
@@ -56,13 +56,7 @@ parser.add_argument(
56
56
  help='Path to look for manifest files',
57
57
  required=False
58
58
  )
59
- parser.add_argument(
60
- '--mode',
61
- default='diff',
62
- help='Integration mode choices are api, github, gitlab, and bitbucket',
63
- choices=["diff", "new", "license"],
64
- required=False
65
- )
59
+
66
60
  parser.add_argument(
67
61
  '--scm',
68
62
  default='api',
@@ -107,7 +101,6 @@ def cli():
107
101
  default_branch = False
108
102
  if default_branch_int == 1:
109
103
  default_branch = True
110
- mode = arguments.mode
111
104
  pr_number = arguments.pr_number
112
105
  target_path = arguments.target_path
113
106
  scm_type = arguments.scm
@@ -131,6 +124,8 @@ def cli():
131
124
  elif scm_type == 'gitlab':
132
125
  from socketsecurity.core.glitlab import Gitlab
133
126
  scm = Gitlab()
127
+ if scm is not None:
128
+ default_branch = scm.is_default_branch
134
129
  base_api_url = os.getenv("BASE_API_URL") or None
135
130
  core = Core(token=api_token, request_timeout=6000, base_api_url=base_api_url)
136
131
  set_as_pending_head = False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: socketsecurity
3
- Version: 0.0.57
3
+ Version: 0.0.59
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 +0,0 @@
1
- __author__ = 'socket.dev'
2
- __version__ = '0.0.57'