Skip to content

Commit a758670

Browse files
authored
Updating README with latest changes (#63)
1 parent 06e2638 commit a758670

File tree

3 files changed

+319
-2
lines changed

3 files changed

+319
-2
lines changed

README.rst

Lines changed: 317 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Initializing the module
2222
- **token (str)** - The Socket API Key for your Organization
2323
- **timeout (int)** - The number of seconds to wait before failing the connection
2424
- **allow_unverified (bool)** - Whether to skip SSL certificate verification (default: False). Set to True for testing with self-signed certificates.
25+
- **user_agent (str, optional)** - Custom User-Agent string to use in API requests. If not provided, defaults to "SocketSDKPython/{version}"
2526

2627
Supported Functions
2728
-------------------
@@ -102,6 +103,35 @@ Export a Socket SBOM as an SPDX SBOM
102103
103104
**PARAMETERS:**
104105

106+
- **org_slug (str)** - The organization name
107+
- **id (str)** - The ID of either a full scan or an SBOM report
108+
- **query_params (ExportQueryParams)** - Optional query parameters for filtering:
109+
- **author (str)** - Filter by author
110+
- **project_group (str)** - Filter by project group
111+
- **project_name (str)** - Filter by project name
112+
- **project_version (str)** - Filter by project version
113+
- **project_id (str)** - Filter by project ID
114+
115+
export.openvex_bom(org_slug, id, query_params)
116+
""""""""""""""""""""""""""""""""""""""""""""""
117+
Export a Socket SBOM as an OpenVEX SBOM
118+
119+
**Usage:**
120+
121+
.. code-block:: python
122+
123+
from socketdev import socketdev
124+
from socketdev.export import ExportQueryParams
125+
126+
socket = socketdev(token="REPLACE_ME")
127+
query_params = ExportQueryParams(
128+
project_name="my-project",
129+
project_version="1.0.0"
130+
)
131+
print(socket.export.openvex_bom("org_slug", "sbom_id", query_params))
132+
133+
**PARAMETERS:**
134+
105135
- **org_slug (str)** - The organization name
106136
- **id (str)** - The ID of either a full scan or an SBOM report
107137
- **query_params (ExportQueryParams)** - Optional query parameters for filtering:
@@ -305,6 +335,24 @@ Get GitHub Flavored Markdown diff between two full scans.
305335
- **before (str)** - The base full scan ID
306336
- **after (str)** - The comparison full scan ID
307337

338+
fullscans.finalize_tier1(full_scan_id, tier1_reachability_scan_id)
339+
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
340+
Finalize a tier 1 reachability scan by associating it with a full scan.
341+
342+
**Usage:**
343+
344+
.. code-block:: python
345+
346+
from socketdev import socketdev
347+
socket = socketdev(token="REPLACE_ME")
348+
success = socket.fullscans.finalize_tier1("full_scan_id", "tier1_reachability_scan_id")
349+
print(f"Finalization successful: {success}")
350+
351+
**PARAMETERS:**
352+
353+
- **full_scan_id (str)** - The ID of the full scan to associate with the tier 1 scan
354+
- **tier1_reachability_scan_id (str)** - The tier 1 reachability scan ID from the facts file
355+
308356
basics.get_config(org_slug, use_types)
309357
""""""""""""""""""""""""""""""""""""""
310358
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.
@@ -1157,3 +1205,272 @@ Retrieve the OpenAPI specification for the Socket API.
11571205
**PARAMETERS:**
11581206

11591207
None required.
1208+
1209+
webhooks.list(org_slug, \*\*query_params)
1210+
"""""""""""""""""""""""""""""""""""""""""""
1211+
List all webhooks for an organization.
1212+
1213+
**Usage:**
1214+
1215+
.. code-block:: python
1216+
1217+
from socketdev import socketdev
1218+
socket = socketdev(token="REPLACE_ME")
1219+
print(socket.webhooks.list("org_slug"))
1220+
1221+
# With query parameters
1222+
print(socket.webhooks.list("org_slug", limit=10, offset=0))
1223+
1224+
**PARAMETERS:**
1225+
1226+
- **org_slug (str)** - The organization slug
1227+
- **query_params** - Optional query parameters for filtering
1228+
1229+
webhooks.create(org_slug, \*\*kwargs)
1230+
""""""""""""""""""""""""""""""""""""""
1231+
Create a new webhook for an organization.
1232+
1233+
**Usage:**
1234+
1235+
.. code-block:: python
1236+
1237+
from socketdev import socketdev
1238+
socket = socketdev(token="REPLACE_ME")
1239+
webhook_config = {
1240+
"url": "https://example.com/webhook",
1241+
"events": ["alert.created", "scan.completed"]
1242+
}
1243+
print(socket.webhooks.create("org_slug", **webhook_config))
1244+
1245+
**PARAMETERS:**
1246+
1247+
- **org_slug (str)** - The organization slug
1248+
- **kwargs** - Webhook configuration parameters
1249+
1250+
webhooks.get(org_slug, webhook_id)
1251+
""""""""""""""""""""""""""""""""""
1252+
Get details for a specific webhook.
1253+
1254+
**Usage:**
1255+
1256+
.. code-block:: python
1257+
1258+
from socketdev import socketdev
1259+
socket = socketdev(token="REPLACE_ME")
1260+
print(socket.webhooks.get("org_slug", "webhook_id"))
1261+
1262+
**PARAMETERS:**
1263+
1264+
- **org_slug (str)** - The organization slug
1265+
- **webhook_id (str)** - The webhook ID
1266+
1267+
webhooks.update(org_slug, webhook_id, \*\*kwargs)
1268+
"""""""""""""""""""""""""""""""""""""""""""""""""""
1269+
Update an existing webhook.
1270+
1271+
**Usage:**
1272+
1273+
.. code-block:: python
1274+
1275+
from socketdev import socketdev
1276+
socket = socketdev(token="REPLACE_ME")
1277+
updates = {
1278+
"url": "https://example.com/new-webhook",
1279+
"events": ["alert.created"]
1280+
}
1281+
print(socket.webhooks.update("org_slug", "webhook_id", **updates))
1282+
1283+
**PARAMETERS:**
1284+
1285+
- **org_slug (str)** - The organization slug
1286+
- **webhook_id (str)** - The webhook ID
1287+
- **kwargs** - Webhook configuration parameters to update
1288+
1289+
webhooks.delete(org_slug, webhook_id)
1290+
"""""""""""""""""""""""""""""""""""""
1291+
Delete a webhook.
1292+
1293+
**Usage:**
1294+
1295+
.. code-block:: python
1296+
1297+
from socketdev import socketdev
1298+
socket = socketdev(token="REPLACE_ME")
1299+
print(socket.webhooks.delete("org_slug", "webhook_id"))
1300+
1301+
**PARAMETERS:**
1302+
1303+
- **org_slug (str)** - The organization slug
1304+
- **webhook_id (str)** - The webhook ID
1305+
1306+
telemetry.get_config(org_slug)
1307+
""""""""""""""""""""""""""""""
1308+
Get telemetry configuration for an organization.
1309+
1310+
**Usage:**
1311+
1312+
.. code-block:: python
1313+
1314+
from socketdev import socketdev
1315+
socket = socketdev(token="REPLACE_ME")
1316+
print(socket.telemetry.get_config("org_slug"))
1317+
1318+
**PARAMETERS:**
1319+
1320+
- **org_slug (str)** - The organization slug
1321+
1322+
telemetry.update_config(org_slug, \*\*kwargs)
1323+
""""""""""""""""""""""""""""""""""""""""""""""
1324+
Update telemetry configuration for an organization.
1325+
1326+
**Usage:**
1327+
1328+
.. code-block:: python
1329+
1330+
from socketdev import socketdev
1331+
socket = socketdev(token="REPLACE_ME")
1332+
config = {
1333+
"enabled": True,
1334+
"sampling_rate": 0.5
1335+
}
1336+
print(socket.telemetry.update_config("org_slug", **config))
1337+
1338+
**PARAMETERS:**
1339+
1340+
- **org_slug (str)** - The organization slug
1341+
- **kwargs** - Configuration parameters to update
1342+
1343+
alerts.get(org_slug, \*\*query_params)
1344+
"""""""""""""""""""""""""""""""""""""""
1345+
Get alerts for an organization.
1346+
1347+
**Usage:**
1348+
1349+
.. code-block:: python
1350+
1351+
from socketdev import socketdev
1352+
socket = socketdev(token="REPLACE_ME")
1353+
print(socket.alerts.get("org_slug"))
1354+
1355+
# With query parameters
1356+
print(socket.alerts.get("org_slug", severity="high", limit=50))
1357+
1358+
**PARAMETERS:**
1359+
1360+
- **org_slug (str)** - The organization slug
1361+
- **query_params** - Optional query parameters for filtering
1362+
1363+
fixes.get(org_slug, \*\*query_params)
1364+
""""""""""""""""""""""""""""""""""""""
1365+
Get available fixes for an organization.
1366+
1367+
**Usage:**
1368+
1369+
.. code-block:: python
1370+
1371+
from socketdev import socketdev
1372+
socket = socketdev(token="REPLACE_ME")
1373+
print(socket.fixes.get("org_slug"))
1374+
1375+
# With query parameters
1376+
print(socket.fixes.get("org_slug", ecosystem="npm"))
1377+
1378+
**PARAMETERS:**
1379+
1380+
- **org_slug (str)** - The organization slug
1381+
- **query_params** - Optional query parameters for filtering
1382+
1383+
supportedfiles.get(org_slug)
1384+
""""""""""""""""""""""""""""
1385+
Get list of supported manifest file types for an organization.
1386+
1387+
**Usage:**
1388+
1389+
.. code-block:: python
1390+
1391+
from socketdev import socketdev
1392+
socket = socketdev(token="REPLACE_ME")
1393+
print(socket.supportedfiles.get("org_slug"))
1394+
1395+
**PARAMETERS:**
1396+
1397+
- **org_slug (str)** - The organization slug
1398+
1399+
alertfullscansearch.search(org_slug, \*\*query_params)
1400+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
1401+
Search alerts across full scans.
1402+
1403+
**Usage:**
1404+
1405+
.. code-block:: python
1406+
1407+
from socketdev import socketdev
1408+
socket = socketdev(token="REPLACE_ME")
1409+
search_params = {
1410+
"query": "CVE-2024-1234",
1411+
"limit": 20
1412+
}
1413+
print(socket.alertfullscansearch.search("org_slug", **search_params))
1414+
1415+
**PARAMETERS:**
1416+
1417+
- **org_slug (str)** - The organization slug
1418+
- **query_params** - Optional query parameters for filtering
1419+
1420+
historical.dependencies_trend(org_slug, query_params)
1421+
""""""""""""""""""""""""""""""""""""""""""""""""""""""
1422+
Get historical dependency trends data for an organization.
1423+
1424+
**Usage:**
1425+
1426+
.. code-block:: python
1427+
1428+
from socketdev import socketdev
1429+
socket = socketdev(token="REPLACE_ME")
1430+
query_params = {
1431+
"from": "2024-01-01",
1432+
"to": "2024-12-31"
1433+
}
1434+
print(socket.historical.dependencies_trend("org_slug", query_params))
1435+
1436+
**PARAMETERS:**
1437+
1438+
- **org_slug (str)** - The organization slug
1439+
- **query_params (dict, optional)** - Optional query parameters for date filtering
1440+
1441+
historical.snapshots.create(org_slug)
1442+
"""""""""""""""""""""""""""""""""""""
1443+
Create a new snapshot for an organization.
1444+
1445+
**Usage:**
1446+
1447+
.. code-block:: python
1448+
1449+
from socketdev import socketdev
1450+
socket = socketdev(token="REPLACE_ME")
1451+
print(socket.historical.snapshots.create("org_slug"))
1452+
1453+
**PARAMETERS:**
1454+
1455+
- **org_slug (str)** - The organization slug
1456+
1457+
historical.snapshots.list(org_slug, query_params)
1458+
"""""""""""""""""""""""""""""""""""""""""""""""""
1459+
List historical snapshots for an organization.
1460+
1461+
**Usage:**
1462+
1463+
.. code-block:: python
1464+
1465+
from socketdev import socketdev
1466+
socket = socketdev(token="REPLACE_ME")
1467+
print(socket.historical.snapshots.list("org_slug"))
1468+
1469+
# With query parameters
1470+
query_params = {"limit": 10, "offset": 0}
1471+
print(socket.historical.snapshots.list("org_slug", query_params))
1472+
1473+
**PARAMETERS:**
1474+
1475+
- **org_slug (str)** - The organization slug
1476+
- **query_params (dict, optional)** - Optional query parameters for filtering

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "socketdev"
7-
version = "3.0.25"
7+
version = "3.0.26"
88
requires-python = ">= 3.9"
99
dependencies = [
1010
'requests',

socketdev/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.0.25"
1+
__version__ = "3.0.26"

0 commit comments

Comments
 (0)