socketdev 3.0.33__py3-none-any.whl → 3.1.1__py3-none-any.whl

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.
socketdev/core/issues.py CHANGED
@@ -463,7 +463,7 @@ class didYouMean:
463
463
 
464
464
  def __init__(self):
465
465
  self.description = "Package name is similar to other popular packages and may not be the package you want."
466
- self.props = {"alternatePackage": "Alternate package", "downloads": "Downloads", "downloadsRatio": "Download ratio", "editDistance": "Edit distance"}
466
+ self.props = {"alternatePackage": "Alternate package", "detectedAt": "Detected at"}
467
467
  self.suggestion = "Use care when consuming similarly named packages and ensure that you did not intend to consume a different package. Malicious packages often publish using similar names as existing popular packages."
468
468
  self.title = "Possible typosquat attack"
469
469
  self.emoji = "\ud83e\uddd0"
@@ -1,5 +1,6 @@
1
1
  import json
2
2
  import urllib.parse
3
+ import warnings
3
4
  from socketdev.log import log
4
5
  from ..core.dedupe import Dedupe
5
6
 
@@ -8,8 +9,21 @@ class Purl:
8
9
  def __init__(self, api):
9
10
  self.api = api
10
11
 
11
- def post(self, license: str = "false", components: list = None, **kwargs) -> list:
12
- path = "purl?"
12
+ def post(
13
+ self,
14
+ license: str = "false",
15
+ components: list = None,
16
+ org_slug: str = None,
17
+ **kwargs,
18
+ ) -> list:
19
+ if org_slug is None:
20
+ warnings.warn(
21
+ "Calling purl.post() without org_slug uses the deprecated POST /v0/purl endpoint. "
22
+ "Pass org_slug to migrate to POST /v0/orgs/{org_slug}/purl.",
23
+ DeprecationWarning,
24
+ stacklevel=2,
25
+ )
26
+ path = f"orgs/{org_slug}/purl?" if org_slug else "purl?"
13
27
  if components is None:
14
28
  components = []
15
29
  purls = {"components": components}
socketdev/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "3.0.33"
1
+ __version__ = "3.1.1"
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: socketdev
3
- Version: 3.0.33
3
+ Version: 3.1.1
4
4
  Summary: Socket Security Python SDK
5
- Project-URL: Homepage, https://github.com/socketdev/socketdev
5
+ Project-URL: Homepage, https://github.com/SocketDev/socket-sdk-python
6
6
  Author-email: Douglas Coburn <douglas@socket.dev>
7
7
  Maintainer-email: Douglas Coburn <douglas@socket.dev>
8
8
  License: MIT License
@@ -78,9 +78,11 @@ Supported Functions
78
78
  -------------------
79
79
 
80
80
 
81
- purl.post(license, components)
82
- """"""""""""""""""""""""""""""
83
- Retrieve the package information for a purl post
81
+ purl.post(license, components, org_slug=None)
82
+ """""""""""""""""""""""""""""""""""""""""""""
83
+ Retrieve package information for one or more PURLs. Pass ``org_slug`` to use the
84
+ current org-scoped endpoint. Omitting ``org_slug`` keeps the legacy deprecated
85
+ endpoint for backwards compatibility.
84
86
 
85
87
  **Usage:**
86
88
 
@@ -88,6 +90,7 @@ Retrieve the package information for a purl post
88
90
 
89
91
  from socketdev import socketdev
90
92
  socket = socketdev(token="REPLACE_ME")
93
+ org_slug = "your-org-slug"
91
94
  license = "true"
92
95
  components = [
93
96
  {
@@ -97,12 +100,13 @@ Retrieve the package information for a purl post
97
100
  "purl": "pkg:pypi/socketsecurity"
98
101
  }
99
102
  ]
100
- print(socket.purl.post(license, components))
103
+ print(socket.purl.post(license, components, org_slug=org_slug))
101
104
 
102
105
  **PARAMETERS:**
103
106
 
104
107
  - **license (str)** - The license parameter if enabled will show alerts and license information. If disabled will only show the basic package metadata and scores. Default is true
105
108
  - **components (array{dict})** - The components list of packages urls
109
+ - **org_slug (str, optional)** - Organization slug for the supported org-scoped PURL endpoint. If omitted, the SDK uses the deprecated legacy endpoint for backwards compatibility.
106
110
 
107
111
  export.cdx_bom(org_slug, id, query_params)
108
112
  """"""""""""""""""""""""""""""""""""""""""
@@ -1,7 +1,7 @@
1
1
  socketdev/__init__.py,sha256=mYuLIlXdU0uec1418LIw_oILBRh5DyWQDpWafaMa_AU,4484
2
2
  socketdev/exceptions.py,sha256=SNU1EgswGwnxI_Zmm325ruP6CFg5C4MsS1qxXWwBJqs,1120
3
3
  socketdev/log.py,sha256=AgEcsPN3y9U-fze8pTFvLigVvNob2vmNC-TkOOQkkeQ,90
4
- socketdev/version.py,sha256=tqG9aXfCFhaqJfXCiep2cJ0kCrLz4J8M0XT3WEa9miI,23
4
+ socketdev/version.py,sha256=14eImCCNxRh4pWMIfkKe4h5OCS1ICfRjHSj2AfgEXa0,22
5
5
  socketdev/alertfullscansearch/__init__.py,sha256=YwXrgnrI9z9rAexXFFmoXQcaQdGW47HRhQ58CQBCG3U,884
6
6
  socketdev/alerts/__init__.py,sha256=kGLCNXtXTRz3vl2s_bPQ7xuds_QGwNQnah1TfHzp2MU,846
7
7
  socketdev/alerttypes/__init__.py,sha256=W-m2D9VxbepSAUELJPmWmX40zksGZbQcSzwQ1kjlB1k,1169
@@ -12,7 +12,7 @@ socketdev/basics/__init__.py,sha256=9jTEwC4dMUV-9pKpU4twK-hM1cY0xeXAxjDrb37sxoQ,
12
12
  socketdev/core/api.py,sha256=KxamwYLe0zbjN31i7bdMSKIUf1g0BUhsllmT5xbHDvg,6190
13
13
  socketdev/core/classes.py,sha256=fyDlolgnkpHFb1dMHa2SA0czCS1I6Tr3SuYb1a67-dY,3756
14
14
  socketdev/core/dedupe.py,sha256=bvX92ia4anVQtEv18LaLupisuHg68eNPuLZjmLhhAGE,5493
15
- socketdev/core/issues.py,sha256=jIfi6h1Y-d38OgxSFhlgC74TLvY6IfUcWhQfLq8FFPo,68147
15
+ socketdev/core/issues.py,sha256=SKhJz7SrglozeuEk72CbbuCM7X0hgzNMk55uM4wX-TI,68081
16
16
  socketdev/dependencies/__init__.py,sha256=zdAb0lMYF8tTHFWa9kGwz5dv4_Sp1UpzQseg_4_qBfY,2170
17
17
  socketdev/diffscans/__init__.py,sha256=ndsgyFmsvK29pJAEhZyBByZ9ampf1Ks6oV8y1q7mssw,5294
18
18
  socketdev/export/__init__.py,sha256=5DqVqHnaK5Aq-ueSTIAplOZJpF21W_pXysIzmMNLGPg,3667
@@ -24,7 +24,7 @@ socketdev/licensemetadata/__init__.py,sha256=pDcvpkc08QtMqhsnKP1Cfjvs3m-MRPYUK-u
24
24
  socketdev/npm/__init__.py,sha256=FvU8z6dY3EsBNLBsKwQKT5soNb6ous1o63aphmbBHh4,906
25
25
  socketdev/openapi/__init__.py,sha256=7Avxgz8RYqC5TCSQCKvmnvzsa2lgV_1y--8eMsy9xYc,500
26
26
  socketdev/org/__init__.py,sha256=2e9fe9jF8V_zb2V-qtmkQZUzJv6qbfpbb1p4Hdgsx9A,903
27
- socketdev/purl/__init__.py,sha256=_ybmj-taH2eArwMPwYX-dO3UA4xoK-TMSgEEvI9Adzg,1345
27
+ socketdev/purl/__init__.py,sha256=TzZz0MlCVaWqX2KYHghsuuRGtSZ2WLjrCYcGpPlNsCQ,1786
28
28
  socketdev/quota/__init__.py,sha256=IblVMP3M7HwXtHs2wnr72GlcNIQtykOKsZKLSehEC8c,487
29
29
  socketdev/report/__init__.py,sha256=L1EuvUnatxWAwQdLiTQwdRNIVglWYoyWqSISuZB0RTE,3454
30
30
  socketdev/repos/__init__.py,sha256=2_BVRYYpA-wF1W9KvhbaBrfe3g2VHLkWLMizWOiyX3A,5641
@@ -39,7 +39,7 @@ socketdev/triage/__init__.py,sha256=-h599vThVetfRSOAs1e4IUoMjcXS8xOsUfub41XPiX4,
39
39
  socketdev/uploadmanifests/__init__.py,sha256=-sFHbOW-aw7U0wRfEJT_Edrzx8aCbzD9cTGmVTNJKpw,6043
40
40
  socketdev/utils/__init__.py,sha256=E11UJTsWsN-ZurOwtKvPGOTc9UMP3ND79nPbmNRRQ6E,17666
41
41
  socketdev/webhooks/__init__.py,sha256=fme6K7ma_Gvk_TFOLz9jVcR5QJbDpMHXqRaU3x_RShY,3507
42
- socketdev-3.0.33.dist-info/METADATA,sha256=DP8HRc7iNcW5CxyR-1drV_1ZIwGcAGD52_3z1yz4OVE,45141
43
- socketdev-3.0.33.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
44
- socketdev-3.0.33.dist-info/licenses/LICENSE,sha256=mC0II_UuE-_gCG9XqOLNyrV3crnROzMpdAetGnMrhpw,1068
45
- socketdev-3.0.33.dist-info/RECORD,,
42
+ socketdev-3.1.1.dist-info/METADATA,sha256=UVGHhTG1EdrD-BR7uKPqcnJ5Tvs9BVyZZypHnJcqMMI,45557
43
+ socketdev-3.1.1.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
44
+ socketdev-3.1.1.dist-info/licenses/LICENSE,sha256=mC0II_UuE-_gCG9XqOLNyrV3crnROzMpdAetGnMrhpw,1068
45
+ socketdev-3.1.1.dist-info/RECORD,,