socketdev 3.0.25__py3-none-any.whl → 3.0.28__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.
@@ -789,6 +789,14 @@ class FullScans:
789
789
  org_slug = str(params.org_slug)
790
790
  params_dict = params.to_dict()
791
791
  params_dict.pop("org_slug")
792
+ # Remove pull_request param if it's None, 0, or not an integer
793
+ if hasattr(params, 'pull_request') and (
794
+ params.pull_request is None or
795
+ not isinstance(params.pull_request, int) or
796
+ params.pull_request == 0
797
+ ):
798
+ print("Removing pull_request param from FullScanParams as it is None, 0, or not an integer")
799
+ params_dict.pop("pull_request")
792
800
  params_arg = urllib.parse.urlencode(params_dict)
793
801
  path = "orgs/" + org_slug + "/full-scans?" + str(params_arg)
794
802
 
@@ -1070,4 +1078,4 @@ class FullScans:
1070
1078
 
1071
1079
  error_message = response.json().get("error", {}).get("message", "Unknown error") if response.text else "Unknown error"
1072
1080
  log.error(f"Error downloading tar files: {response.status_code}, message: {error_message}")
1073
- return b""
1081
+ return b""
socketdev/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "3.0.25"
1
+ __version__ = "3.0.28"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: socketdev
3
- Version: 3.0.25
3
+ Version: 3.0.28
4
4
  Summary: Socket Security Python SDK
5
5
  Project-URL: Homepage, https://github.com/socketdev/socketdev
6
6
  Author-email: Douglas Coburn <douglas@socket.dev>
@@ -73,6 +73,7 @@ Initializing the module
73
73
  - **token (str)** - The Socket API Key for your Organization
74
74
  - **timeout (int)** - The number of seconds to wait before failing the connection
75
75
  - **allow_unverified (bool)** - Whether to skip SSL certificate verification (default: False). Set to True for testing with self-signed certificates.
76
+ - **user_agent (str, optional)** - Custom User-Agent string to use in API requests. If not provided, defaults to "SocketSDKPython/{version}"
76
77
 
77
78
  Supported Functions
78
79
  -------------------
@@ -153,6 +154,35 @@ Export a Socket SBOM as an SPDX SBOM
153
154
 
154
155
  **PARAMETERS:**
155
156
 
157
+ - **org_slug (str)** - The organization name
158
+ - **id (str)** - The ID of either a full scan or an SBOM report
159
+ - **query_params (ExportQueryParams)** - Optional query parameters for filtering:
160
+ - **author (str)** - Filter by author
161
+ - **project_group (str)** - Filter by project group
162
+ - **project_name (str)** - Filter by project name
163
+ - **project_version (str)** - Filter by project version
164
+ - **project_id (str)** - Filter by project ID
165
+
166
+ export.openvex_bom(org_slug, id, query_params)
167
+ """"""""""""""""""""""""""""""""""""""""""""""
168
+ Export a Socket SBOM as an OpenVEX SBOM
169
+
170
+ **Usage:**
171
+
172
+ .. code-block:: python
173
+
174
+ from socketdev import socketdev
175
+ from socketdev.export import ExportQueryParams
176
+
177
+ socket = socketdev(token="REPLACE_ME")
178
+ query_params = ExportQueryParams(
179
+ project_name="my-project",
180
+ project_version="1.0.0"
181
+ )
182
+ print(socket.export.openvex_bom("org_slug", "sbom_id", query_params))
183
+
184
+ **PARAMETERS:**
185
+
156
186
  - **org_slug (str)** - The organization name
157
187
  - **id (str)** - The ID of either a full scan or an SBOM report
158
188
  - **query_params (ExportQueryParams)** - Optional query parameters for filtering:
@@ -356,6 +386,24 @@ Get GitHub Flavored Markdown diff between two full scans.
356
386
  - **before (str)** - The base full scan ID
357
387
  - **after (str)** - The comparison full scan ID
358
388
 
389
+ fullscans.finalize_tier1(full_scan_id, tier1_reachability_scan_id)
390
+ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
391
+ Finalize a tier 1 reachability scan by associating it with a full scan.
392
+
393
+ **Usage:**
394
+
395
+ .. code-block:: python
396
+
397
+ from socketdev import socketdev
398
+ socket = socketdev(token="REPLACE_ME")
399
+ success = socket.fullscans.finalize_tier1("full_scan_id", "tier1_reachability_scan_id")
400
+ print(f"Finalization successful: {success}")
401
+
402
+ **PARAMETERS:**
403
+
404
+ - **full_scan_id (str)** - The ID of the full scan to associate with the tier 1 scan
405
+ - **tier1_reachability_scan_id (str)** - The tier 1 reachability scan ID from the facts file
406
+
359
407
  basics.get_config(org_slug, use_types)
360
408
  """"""""""""""""""""""""""""""""""""""
361
409
  Get Socket Basics configuration for an organization. Socket Basics is a CI/CD security scanning suite that includes SAST scanning, secret detection, container security, and dependency analysis.
@@ -1208,3 +1256,272 @@ Retrieve the OpenAPI specification for the Socket API.
1208
1256
  **PARAMETERS:**
1209
1257
 
1210
1258
  None required.
1259
+
1260
+ webhooks.list(org_slug, \*\*query_params)
1261
+ """""""""""""""""""""""""""""""""""""""""""
1262
+ List all webhooks for an organization.
1263
+
1264
+ **Usage:**
1265
+
1266
+ .. code-block:: python
1267
+
1268
+ from socketdev import socketdev
1269
+ socket = socketdev(token="REPLACE_ME")
1270
+ print(socket.webhooks.list("org_slug"))
1271
+
1272
+ # With query parameters
1273
+ print(socket.webhooks.list("org_slug", limit=10, offset=0))
1274
+
1275
+ **PARAMETERS:**
1276
+
1277
+ - **org_slug (str)** - The organization slug
1278
+ - **query_params** - Optional query parameters for filtering
1279
+
1280
+ webhooks.create(org_slug, \*\*kwargs)
1281
+ """"""""""""""""""""""""""""""""""""""
1282
+ Create a new webhook for an organization.
1283
+
1284
+ **Usage:**
1285
+
1286
+ .. code-block:: python
1287
+
1288
+ from socketdev import socketdev
1289
+ socket = socketdev(token="REPLACE_ME")
1290
+ webhook_config = {
1291
+ "url": "https://example.com/webhook",
1292
+ "events": ["alert.created", "scan.completed"]
1293
+ }
1294
+ print(socket.webhooks.create("org_slug", **webhook_config))
1295
+
1296
+ **PARAMETERS:**
1297
+
1298
+ - **org_slug (str)** - The organization slug
1299
+ - **kwargs** - Webhook configuration parameters
1300
+
1301
+ webhooks.get(org_slug, webhook_id)
1302
+ """"""""""""""""""""""""""""""""""
1303
+ Get details for a specific webhook.
1304
+
1305
+ **Usage:**
1306
+
1307
+ .. code-block:: python
1308
+
1309
+ from socketdev import socketdev
1310
+ socket = socketdev(token="REPLACE_ME")
1311
+ print(socket.webhooks.get("org_slug", "webhook_id"))
1312
+
1313
+ **PARAMETERS:**
1314
+
1315
+ - **org_slug (str)** - The organization slug
1316
+ - **webhook_id (str)** - The webhook ID
1317
+
1318
+ webhooks.update(org_slug, webhook_id, \*\*kwargs)
1319
+ """""""""""""""""""""""""""""""""""""""""""""""""""
1320
+ Update an existing webhook.
1321
+
1322
+ **Usage:**
1323
+
1324
+ .. code-block:: python
1325
+
1326
+ from socketdev import socketdev
1327
+ socket = socketdev(token="REPLACE_ME")
1328
+ updates = {
1329
+ "url": "https://example.com/new-webhook",
1330
+ "events": ["alert.created"]
1331
+ }
1332
+ print(socket.webhooks.update("org_slug", "webhook_id", **updates))
1333
+
1334
+ **PARAMETERS:**
1335
+
1336
+ - **org_slug (str)** - The organization slug
1337
+ - **webhook_id (str)** - The webhook ID
1338
+ - **kwargs** - Webhook configuration parameters to update
1339
+
1340
+ webhooks.delete(org_slug, webhook_id)
1341
+ """""""""""""""""""""""""""""""""""""
1342
+ Delete a webhook.
1343
+
1344
+ **Usage:**
1345
+
1346
+ .. code-block:: python
1347
+
1348
+ from socketdev import socketdev
1349
+ socket = socketdev(token="REPLACE_ME")
1350
+ print(socket.webhooks.delete("org_slug", "webhook_id"))
1351
+
1352
+ **PARAMETERS:**
1353
+
1354
+ - **org_slug (str)** - The organization slug
1355
+ - **webhook_id (str)** - The webhook ID
1356
+
1357
+ telemetry.get_config(org_slug)
1358
+ """"""""""""""""""""""""""""""
1359
+ Get telemetry configuration for an organization.
1360
+
1361
+ **Usage:**
1362
+
1363
+ .. code-block:: python
1364
+
1365
+ from socketdev import socketdev
1366
+ socket = socketdev(token="REPLACE_ME")
1367
+ print(socket.telemetry.get_config("org_slug"))
1368
+
1369
+ **PARAMETERS:**
1370
+
1371
+ - **org_slug (str)** - The organization slug
1372
+
1373
+ telemetry.update_config(org_slug, \*\*kwargs)
1374
+ """"""""""""""""""""""""""""""""""""""""""""""
1375
+ Update telemetry configuration for an organization.
1376
+
1377
+ **Usage:**
1378
+
1379
+ .. code-block:: python
1380
+
1381
+ from socketdev import socketdev
1382
+ socket = socketdev(token="REPLACE_ME")
1383
+ config = {
1384
+ "enabled": True,
1385
+ "sampling_rate": 0.5
1386
+ }
1387
+ print(socket.telemetry.update_config("org_slug", **config))
1388
+
1389
+ **PARAMETERS:**
1390
+
1391
+ - **org_slug (str)** - The organization slug
1392
+ - **kwargs** - Configuration parameters to update
1393
+
1394
+ alerts.get(org_slug, \*\*query_params)
1395
+ """""""""""""""""""""""""""""""""""""""
1396
+ Get alerts for an organization.
1397
+
1398
+ **Usage:**
1399
+
1400
+ .. code-block:: python
1401
+
1402
+ from socketdev import socketdev
1403
+ socket = socketdev(token="REPLACE_ME")
1404
+ print(socket.alerts.get("org_slug"))
1405
+
1406
+ # With query parameters
1407
+ print(socket.alerts.get("org_slug", severity="high", limit=50))
1408
+
1409
+ **PARAMETERS:**
1410
+
1411
+ - **org_slug (str)** - The organization slug
1412
+ - **query_params** - Optional query parameters for filtering
1413
+
1414
+ fixes.get(org_slug, \*\*query_params)
1415
+ """"""""""""""""""""""""""""""""""""""
1416
+ Get available fixes for an organization.
1417
+
1418
+ **Usage:**
1419
+
1420
+ .. code-block:: python
1421
+
1422
+ from socketdev import socketdev
1423
+ socket = socketdev(token="REPLACE_ME")
1424
+ print(socket.fixes.get("org_slug"))
1425
+
1426
+ # With query parameters
1427
+ print(socket.fixes.get("org_slug", ecosystem="npm"))
1428
+
1429
+ **PARAMETERS:**
1430
+
1431
+ - **org_slug (str)** - The organization slug
1432
+ - **query_params** - Optional query parameters for filtering
1433
+
1434
+ supportedfiles.get(org_slug)
1435
+ """"""""""""""""""""""""""""
1436
+ Get list of supported manifest file types for an organization.
1437
+
1438
+ **Usage:**
1439
+
1440
+ .. code-block:: python
1441
+
1442
+ from socketdev import socketdev
1443
+ socket = socketdev(token="REPLACE_ME")
1444
+ print(socket.supportedfiles.get("org_slug"))
1445
+
1446
+ **PARAMETERS:**
1447
+
1448
+ - **org_slug (str)** - The organization slug
1449
+
1450
+ alertfullscansearch.search(org_slug, \*\*query_params)
1451
+ """""""""""""""""""""""""""""""""""""""""""""""""""""""
1452
+ Search alerts across full scans.
1453
+
1454
+ **Usage:**
1455
+
1456
+ .. code-block:: python
1457
+
1458
+ from socketdev import socketdev
1459
+ socket = socketdev(token="REPLACE_ME")
1460
+ search_params = {
1461
+ "query": "CVE-2024-1234",
1462
+ "limit": 20
1463
+ }
1464
+ print(socket.alertfullscansearch.search("org_slug", **search_params))
1465
+
1466
+ **PARAMETERS:**
1467
+
1468
+ - **org_slug (str)** - The organization slug
1469
+ - **query_params** - Optional query parameters for filtering
1470
+
1471
+ historical.dependencies_trend(org_slug, query_params)
1472
+ """"""""""""""""""""""""""""""""""""""""""""""""""""""
1473
+ Get historical dependency trends data for an organization.
1474
+
1475
+ **Usage:**
1476
+
1477
+ .. code-block:: python
1478
+
1479
+ from socketdev import socketdev
1480
+ socket = socketdev(token="REPLACE_ME")
1481
+ query_params = {
1482
+ "from": "2024-01-01",
1483
+ "to": "2024-12-31"
1484
+ }
1485
+ print(socket.historical.dependencies_trend("org_slug", query_params))
1486
+
1487
+ **PARAMETERS:**
1488
+
1489
+ - **org_slug (str)** - The organization slug
1490
+ - **query_params (dict, optional)** - Optional query parameters for date filtering
1491
+
1492
+ historical.snapshots.create(org_slug)
1493
+ """""""""""""""""""""""""""""""""""""
1494
+ Create a new snapshot for an organization.
1495
+
1496
+ **Usage:**
1497
+
1498
+ .. code-block:: python
1499
+
1500
+ from socketdev import socketdev
1501
+ socket = socketdev(token="REPLACE_ME")
1502
+ print(socket.historical.snapshots.create("org_slug"))
1503
+
1504
+ **PARAMETERS:**
1505
+
1506
+ - **org_slug (str)** - The organization slug
1507
+
1508
+ historical.snapshots.list(org_slug, query_params)
1509
+ """""""""""""""""""""""""""""""""""""""""""""""""
1510
+ List historical snapshots for an organization.
1511
+
1512
+ **Usage:**
1513
+
1514
+ .. code-block:: python
1515
+
1516
+ from socketdev import socketdev
1517
+ socket = socketdev(token="REPLACE_ME")
1518
+ print(socket.historical.snapshots.list("org_slug"))
1519
+
1520
+ # With query parameters
1521
+ query_params = {"limit": 10, "offset": 0}
1522
+ print(socket.historical.snapshots.list("org_slug", query_params))
1523
+
1524
+ **PARAMETERS:**
1525
+
1526
+ - **org_slug (str)** - The organization slug
1527
+ - **query_params (dict, optional)** - Optional query parameters for filtering
@@ -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=MMVprXHVt6ISLQw_xJGSq2LUkN77n9L5I5MyPittz60,23
4
+ socketdev/version.py,sha256=wx88GcsnLfHTbyJHdYlQ-jeGfNB3mjpjh2Xyqg6BUtk,23
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
@@ -17,7 +17,7 @@ socketdev/dependencies/__init__.py,sha256=zdAb0lMYF8tTHFWa9kGwz5dv4_Sp1UpzQseg_4
17
17
  socketdev/diffscans/__init__.py,sha256=ndsgyFmsvK29pJAEhZyBByZ9ampf1Ks6oV8y1q7mssw,5294
18
18
  socketdev/export/__init__.py,sha256=5DqVqHnaK5Aq-ueSTIAplOZJpF21W_pXysIzmMNLGPg,3667
19
19
  socketdev/fixes/__init__.py,sha256=ouRSQ5FcqQcjAmrU8aAgd0ZJeo431wBOEVKLR36etik,856
20
- socketdev/fullscans/__init__.py,sha256=QaxFUfpQLdVqLiL5mxCnU-t-ZwLvTrUwSEY69ihEn-g,36399
20
+ socketdev/fullscans/__init__.py,sha256=cf_n0ggtp6frRWz3eklhrFDPuaRFHy-APMkZoA6abH0,36818
21
21
  socketdev/historical/__init__.py,sha256=DXFmRrHLWHKbZrB8eermM4YG6j4C1S4Lz6-V63_p2gs,3472
22
22
  socketdev/labels/__init__.py,sha256=Ep19ZraKqi_a-3-eAOWGhPNQsgwGRY9N28Oyxlxrz-g,5128
23
23
  socketdev/licensemetadata/__init__.py,sha256=pDcvpkc08QtMqhsnKP1Cfjvs3m-MRPYUK-uLh8aRkrU,815
@@ -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.25.dist-info/METADATA,sha256=eFTw6GtiGzpA9l_lDqfCHoIxAuTpPJXbXiPaMeogBns,36240
43
- socketdev-3.0.25.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
44
- socketdev-3.0.25.dist-info/licenses/LICENSE,sha256=mC0II_UuE-_gCG9XqOLNyrV3crnROzMpdAetGnMrhpw,1068
45
- socketdev-3.0.25.dist-info/RECORD,,
42
+ socketdev-3.0.28.dist-info/METADATA,sha256=1AIkzHXW7OPZv4sYmNk95Mc9jUm-Urz48jXKzmrQhRo,44677
43
+ socketdev-3.0.28.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
44
+ socketdev-3.0.28.dist-info/licenses/LICENSE,sha256=mC0II_UuE-_gCG9XqOLNyrV3crnROzMpdAetGnMrhpw,1068
45
+ socketdev-3.0.28.dist-info/RECORD,,