socketdev 3.6.1__tar.gz → 3.6.3__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.
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/actions/setup-sfw/action.yml +1 -1
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/workflows/api-drift-check.yml +1 -1
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/workflows/package-check.yml +1 -1
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/workflows/pr-preview.yml +2 -2
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/workflows/release.yml +2 -2
- {socketdev-3.6.1 → socketdev-3.6.3}/CHANGELOG.md +40 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/PKG-INFO +387 -3
- {socketdev-3.6.1 → socketdev-3.6.3}/README.rst +386 -2
- {socketdev-3.6.1 → socketdev-3.6.3}/pyproject.toml +1 -1
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/__init__.py +5 -9
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/core/api.py +7 -1
- socketdev-3.6.3/socketdev/core/retired_token.py +34 -0
- socketdev-3.6.3/socketdev/core/token_selection.py +19 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/fullscans/__init__.py +61 -4
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/settings/__init__.py +6 -3
- socketdev-3.6.3/socketdev/version.py +1 -0
- socketdev-3.6.3/tests/support/socket_api_fixture.py +121 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/unit/test_all_endpoints_unit.py +27 -0
- socketdev-3.6.3/tests/unit/test_full_scan_cached_polling_http.py +182 -0
- socketdev-3.6.3/tests/unit/test_retired_token.py +85 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/unit/test_socket_purl_type.py +29 -21
- {socketdev-3.6.1 → socketdev-3.6.3}/uv.lock +39 -39
- socketdev-3.6.1/socketdev/version.py +0 -1
- {socketdev-3.6.1 → socketdev-3.6.3}/.gitattributes +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/CODEOWNERS +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/actions/setup-hatch/action.yml +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/dependabot.yml +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/workflows/dependency-review.yml +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/.github/workflows/version-check.yml +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/.gitignore +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/.hooks/sync_version.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/.python-version +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/CONTRIBUTING.md +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/LICENSE +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/scripts/build.sh +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/scripts/check_api_enum_drift.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/scripts/deploy-test-pypi.sh +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/alertfullscansearch/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/alerts/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/alerttypes/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/analytics/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/apitokens/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/auditlog/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/basics/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/core/classes.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/core/dedupe.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/core/enums.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/core/issues.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/dependencies/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/diffscans/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/exceptions.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/export/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/fixes/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/historical/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/labels/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/licensemetadata/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/log.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/npm/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/openapi/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/org/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/purl/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/quota/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/report/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/repos/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/repositories/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/sbom/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/supportedfiles/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/telemetry/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/threatfeed/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/tools/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/triage/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/uploadmanifests/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/utils/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/socketdev/webhooks/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/README.md +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/conftest.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/integration/test_all_endpoints.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/integration/test_comprehensive_integration.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/integration/test_diffscans_integration.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/integration/test_new_endpoints.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/run_tests.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/unit/__init__.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/unit/test_dedupe.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/unit/test_enum_forward_compat.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/unit/test_exceptions.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/unit/test_issues_did_you_mean_props.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/unit/test_socket_alert_category.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/unit/test_socket_sdk_unit.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/unit/test_upload_manifests.py +0 -0
- {socketdev-3.6.1 → socketdev-3.6.3}/tests/unit/test_working_endpoints_unit.py +0 -0
|
@@ -24,7 +24,7 @@ runs:
|
|
|
24
24
|
using: "composite"
|
|
25
25
|
steps:
|
|
26
26
|
- if: ${{ inputs.python == 'true' || inputs.uv == 'true' }}
|
|
27
|
-
uses: actions/setup-python@
|
|
27
|
+
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
28
28
|
with:
|
|
29
29
|
python-version: "3.12"
|
|
30
30
|
|
|
@@ -92,7 +92,7 @@ jobs:
|
|
|
92
92
|
fetch-depth: 0
|
|
93
93
|
persist-credentials: false
|
|
94
94
|
|
|
95
|
-
- uses: actions/setup-python@
|
|
95
|
+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
96
96
|
with:
|
|
97
97
|
python-version: "3.12"
|
|
98
98
|
|
|
@@ -150,7 +150,7 @@ jobs:
|
|
|
150
150
|
path: dist
|
|
151
151
|
|
|
152
152
|
- name: Publish to TestPyPI
|
|
153
|
-
uses: pypa/gh-action-pypi-publish@
|
|
153
|
+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
154
154
|
with:
|
|
155
155
|
repository-url: https://test.pypi.org/legacy/
|
|
156
156
|
verbose: true
|
|
@@ -14,7 +14,7 @@ jobs:
|
|
|
14
14
|
with:
|
|
15
15
|
fetch-depth: 0
|
|
16
16
|
persist-credentials: false
|
|
17
|
-
- uses: actions/setup-python@
|
|
17
|
+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
18
18
|
with:
|
|
19
19
|
python-version: '3.13'
|
|
20
20
|
|
|
@@ -53,7 +53,7 @@ jobs:
|
|
|
53
53
|
|
|
54
54
|
- name: Publish to PyPI
|
|
55
55
|
if: steps.version_check.outputs.pypi_exists != 'true'
|
|
56
|
-
uses: pypa/gh-action-pypi-publish@
|
|
56
|
+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
57
57
|
|
|
58
58
|
- name: Verify package is installable
|
|
59
59
|
id: verify_package
|
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.6.3
|
|
4
|
+
|
|
5
|
+
### Fixed: `settings.integration_events()` requested the wrong path
|
|
6
|
+
|
|
7
|
+
- `settings.integration_events()` now calls
|
|
8
|
+
`GET orgs/{org_slug}/settings/integrations/{integration_id}/events`. It
|
|
9
|
+
previously requested the integration's own path, which has no `GET` route,
|
|
10
|
+
so the method always failed. It needs the `integration:list` scope.
|
|
11
|
+
- Its return annotation is now `list`, matching the JSON array the endpoint
|
|
12
|
+
returns.
|
|
13
|
+
|
|
14
|
+
## 3.6.2
|
|
15
|
+
|
|
16
|
+
### Fixed: reject retired API credentials before use
|
|
17
|
+
|
|
18
|
+
- The SDK rejects the retired API credential before storing or encoding it.
|
|
19
|
+
|
|
20
|
+
### Fixed: full-scan reads wait for analysis to finish
|
|
21
|
+
|
|
22
|
+
- `fullscans.stream()` now requests cached results (`?cached=true`) and polls
|
|
23
|
+
while the API answers `202 Processing`, instead of treating the first `202`
|
|
24
|
+
as a failed result. Polling backs off from 5s to 10s between attempts and
|
|
25
|
+
stops when the budget runs out, raising `APITimeout`.
|
|
26
|
+
- The polling budget defaults to the SDK's configured `timeout`. Callers can
|
|
27
|
+
tune it with the new keyword-only arguments `poll_timeout_seconds`,
|
|
28
|
+
`poll_initial_interval_seconds` and `poll_max_interval_seconds`. Each
|
|
29
|
+
request is bounded by the configured `timeout` or the remaining budget,
|
|
30
|
+
whichever is shorter, and polling stops early once the next attempt could
|
|
31
|
+
not start before the budget runs out.
|
|
32
|
+
- Transient failures (HTTP 408/502/503/504, timeouts, dropped connections) are
|
|
33
|
+
retried within the budget. Authorization, not-found and quota errors still
|
|
34
|
+
raise immediately.
|
|
35
|
+
- Invalid polling settings (zero, negative, non-finite, booleans, or an
|
|
36
|
+
initial interval above the maximum) raise `ValueError` before any request is
|
|
37
|
+
sent.
|
|
38
|
+
- The organization slug and full scan ID are now URL-encoded in the request
|
|
39
|
+
path.
|
|
40
|
+
- `API.do_request()` accepts an optional keyword-only `request_timeout` that
|
|
41
|
+
overrides the configured timeout for a single call.
|
|
42
|
+
|
|
3
43
|
## 3.6.1
|
|
4
44
|
|
|
5
45
|
### Security: patched releases of certifi, uv and virtualenv
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: socketdev
|
|
3
|
-
Version: 3.6.
|
|
3
|
+
Version: 3.6.3
|
|
4
4
|
Summary: Socket Security Python SDK
|
|
5
5
|
Project-URL: Homepage, https://github.com/SocketDev/socket-sdk-python
|
|
6
6
|
Author-email: Douglas Coburn <douglas@socket.dev>
|
|
@@ -75,7 +75,7 @@ Initializing the module
|
|
|
75
75
|
|
|
76
76
|
**PARAMETERS:**
|
|
77
77
|
|
|
78
|
-
- **token (str)** - The Socket API Key for your Organization
|
|
78
|
+
- **token (str)** - The Socket API Key for your Organization. Each method needs the token to carry particular scopes; see `API token scopes`_
|
|
79
79
|
- **timeout (int)** - The number of seconds to wait before failing the connection
|
|
80
80
|
- **allow_unverified (bool)** - Whether to skip SSL certificate verification (default: False). Set to True for testing with self-signed certificates.
|
|
81
81
|
- **user_agent (str, optional)** - Custom User-Agent string to use in API requests. If not provided, defaults to "SocketSDKPython/{version}"
|
|
@@ -342,7 +342,11 @@ Stream a diff between two full scans. Returns a scan diff.
|
|
|
342
342
|
|
|
343
343
|
fullscans.stream(org_slug, full_scan_id, use_types=False)
|
|
344
344
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
345
|
-
Stream all SBOM artifacts for a full scan.
|
|
345
|
+
Stream all SBOM artifacts for a full scan. If the scan is still being analyzed, the SDK polls
|
|
346
|
+
cached results until they are ready, backing off from 5 to 10 seconds between attempts, and
|
|
347
|
+
raises ``APITimeout`` if they are not ready within the polling budget. Transient failures
|
|
348
|
+
(HTTP 408/502/503/504, timeouts, dropped connections) are retried within the budget; other
|
|
349
|
+
errors raise immediately.
|
|
346
350
|
|
|
347
351
|
**Usage:**
|
|
348
352
|
|
|
@@ -355,11 +359,17 @@ Stream all SBOM artifacts for a full scan.
|
|
|
355
359
|
# With typed response
|
|
356
360
|
print(socket.fullscans.stream("org_slug", "full_scan_id", use_types=True))
|
|
357
361
|
|
|
362
|
+
# Wait up to 10 minutes for analysis to finish
|
|
363
|
+
print(socket.fullscans.stream("org_slug", "full_scan_id", poll_timeout_seconds=600))
|
|
364
|
+
|
|
358
365
|
**PARAMETERS:**
|
|
359
366
|
|
|
360
367
|
- **org_slug (str)** - The organization name
|
|
361
368
|
- **full_scan_id (str)** - The ID of the full scan
|
|
362
369
|
- **use_types (bool)** - Whether to return typed response objects (default: False)
|
|
370
|
+
- **poll_timeout_seconds (float)** - Keyword-only. Total time to wait for results (default: the SDK's configured ``timeout``)
|
|
371
|
+
- **poll_initial_interval_seconds (float)** - Keyword-only. Wait before the first retry (default: 5.0)
|
|
372
|
+
- **poll_max_interval_seconds (float)** - Keyword-only. Longest wait between retries (default: 10.0)
|
|
363
373
|
|
|
364
374
|
fullscans.metadata(org_slug, full_scan_id, use_types=False)
|
|
365
375
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
@@ -1539,3 +1549,377 @@ List historical snapshots for an organization.
|
|
|
1539
1549
|
|
|
1540
1550
|
- **org_slug (str)** - The organization slug
|
|
1541
1551
|
- **query_params (dict, optional)** - Optional query parameters for filtering
|
|
1552
|
+
|
|
1553
|
+
|
|
1554
|
+
API token scopes
|
|
1555
|
+
----------------
|
|
1556
|
+
|
|
1557
|
+
The SDK authenticates every call with one organization API token, and each Socket API
|
|
1558
|
+
endpoint checks that the token carries particular scopes. The table below lists, for each
|
|
1559
|
+
SDK method, the endpoint it calls and the scopes that endpoint checks. Where an endpoint
|
|
1560
|
+
lists more than one scope, the token needs all of them. "none" means the endpoint checks
|
|
1561
|
+
no scope, so any valid token for the organization works. Paths are relative to
|
|
1562
|
+
``https://api.socket.dev/v0/``; query strings are omitted.
|
|
1563
|
+
|
|
1564
|
+
The scopes each endpoint checks are also listed in the
|
|
1565
|
+
`API reference <https://docs.socket.dev/reference>`_. For a least-privilege token, grant
|
|
1566
|
+
only the scopes of the methods your integration calls.
|
|
1567
|
+
|
|
1568
|
+
Scopes are grouped by their prefix, and a token that holds a group holds every scope in
|
|
1569
|
+
it: ``full-scans`` covers ``full-scans:list``, ``full-scans:create`` and
|
|
1570
|
+
``full-scans:delete``. When a token is given every scope of a group, the API stores and
|
|
1571
|
+
reports the group name instead, so a token created with ``packages:list``, the only
|
|
1572
|
+
scope in its group, is listed with ``packages``.
|
|
1573
|
+
|
|
1574
|
+
Scopes are not the only check. A token restricted to specific repositories is rejected
|
|
1575
|
+
by some endpoints whatever scopes it holds, and organizations that restrict repository
|
|
1576
|
+
access apply per-repository checks on top of the scopes listed here.
|
|
1577
|
+
|
|
1578
|
+
Missing scopes and other 403 responses
|
|
1579
|
+
""""""""""""""""""""""""""""""""""""""
|
|
1580
|
+
|
|
1581
|
+
Methods do not return an empty result on a 401 or 403. ``API.do_request()`` raises
|
|
1582
|
+
before the method sees the response, so the exception reaches the caller, including when
|
|
1583
|
+
``use_types=True``.
|
|
1584
|
+
|
|
1585
|
+
A missing scope raises ``APIAccessDenied`` with ``status_code`` 403. Its message starts
|
|
1586
|
+
with the server's ``Insufficient permissions``, followed by the request URL and the
|
|
1587
|
+
response headers. A 401, from a bad or revoked token, also raises ``APIAccessDenied``,
|
|
1588
|
+
with ``Unauthorized`` in the message.
|
|
1589
|
+
|
|
1590
|
+
Recent API responses name the required scopes in the 403 body under
|
|
1591
|
+
``error.details.requiredScopes``, but the SDK does not include them in the exception
|
|
1592
|
+
message; to see them, look up the endpoint in the table below or the API reference.
|
|
1593
|
+
|
|
1594
|
+
A token restricted to specific repositories gets the same exception from an endpoint
|
|
1595
|
+
that does not accept such tokens. Its message starts with ``This endpoint does not
|
|
1596
|
+
support repository-scoped tokens``.
|
|
1597
|
+
|
|
1598
|
+
A 403 whose message contains ``Insufficient max quota`` raises ``APIInsufficientQuota``
|
|
1599
|
+
instead, as does a 429, and logs the server's message at ``ERROR`` on the ``socketdev``
|
|
1600
|
+
logger.
|
|
1601
|
+
|
|
1602
|
+
``socketdev.exceptions`` also defines ``APIInsufficientPermissions`` and
|
|
1603
|
+
``APIOrganizationNotAllowed``. The SDK raises them for 403 messages containing
|
|
1604
|
+
``Insufficient permissions for API method`` and ``Organization not allowed``, which the
|
|
1605
|
+
API does not currently send. Do not rely on either to detect a missing scope: catch
|
|
1606
|
+
``APIAccessDenied``.
|
|
1607
|
+
|
|
1608
|
+
All of these classes carry the HTTP status in ``status_code`` and subclass
|
|
1609
|
+
``APIFailure``, so catching ``APIFailure`` covers every case.
|
|
1610
|
+
|
|
1611
|
+
.. code-block:: python
|
|
1612
|
+
|
|
1613
|
+
from socketdev import socketdev
|
|
1614
|
+
from socketdev.exceptions import APIAccessDenied
|
|
1615
|
+
|
|
1616
|
+
socket = socketdev(token="REPLACE_ME")
|
|
1617
|
+
try:
|
|
1618
|
+
socket.diffscans.list("org_slug")
|
|
1619
|
+
except APIAccessDenied as error:
|
|
1620
|
+
if error.status_code == 403:
|
|
1621
|
+
print("Access denied; check the token's scopes for this method:", error)
|
|
1622
|
+
raise
|
|
1623
|
+
|
|
1624
|
+
Scopes by method
|
|
1625
|
+
""""""""""""""""
|
|
1626
|
+
|
|
1627
|
+
A few rows need a note:
|
|
1628
|
+
|
|
1629
|
+
- "Deprecated" marks an endpoint the API reference lists as deprecated. Prefer the
|
|
1630
|
+
method the reference names as its successor. ``report.view()`` calls
|
|
1631
|
+
``GET report/view/{id}``, which the reference says will be removed on 2026-11-20;
|
|
1632
|
+
use ``fullscans`` instead.
|
|
1633
|
+
- ``fullscans.finalize_tier1()``, ``uploadmanifests.upload_manifest_files()`` and
|
|
1634
|
+
``sbom.view()`` call endpoints the API reference does not list. Their scopes are
|
|
1635
|
+
given in the table.
|
|
1636
|
+
- Three calls request a path the API has no route for, so they fail with a 404
|
|
1637
|
+
(``APIResourceNotFound``) whatever the token: ``apitokens.update()`` when
|
|
1638
|
+
``token_id`` is passed, ``dependencies.get()`` when ``org_slug``, ``ecosystem``,
|
|
1639
|
+
``package`` and ``version`` are all passed, and ``repositories.list()``. Call
|
|
1640
|
+
``apitokens.update()`` without ``token_id``, and use ``repos.get()`` to list
|
|
1641
|
+
repositories.
|
|
1642
|
+
- ``dependencies.get()`` otherwise calls ``POST dependencies/search``. That endpoint
|
|
1643
|
+
accepts any valid token, but it returns only results from repositories the token can
|
|
1644
|
+
read under ``dependencies:list``. Depending on how the organization restricts
|
|
1645
|
+
repository access, a token without that scope gets an empty result instead of a 403,
|
|
1646
|
+
so grant ``dependencies:list``.
|
|
1647
|
+
- Some scopes differ from what the method name suggests: ``analytics.get_org()`` and
|
|
1648
|
+
``analytics.get_repo()`` check ``report:write``; ``apitokens.update()`` checks
|
|
1649
|
+
``api-tokens:create``; ``labels.setting.delete()`` checks ``repo-label:update``; and
|
|
1650
|
+
the ``export`` methods check ``report:read`` rather than a full-scans scope.
|
|
1651
|
+
|
|
1652
|
+
.. list-table::
|
|
1653
|
+
:header-rows: 1
|
|
1654
|
+
:widths: 30 45 25
|
|
1655
|
+
|
|
1656
|
+
* - Method
|
|
1657
|
+
- Endpoint
|
|
1658
|
+
- Scopes
|
|
1659
|
+
* - ``alertfullscansearch.search()``
|
|
1660
|
+
- ``GET orgs/{org_slug}/alert-full-scan-search``
|
|
1661
|
+
- ``alerts:list``
|
|
1662
|
+
* - ``alerts.get()``
|
|
1663
|
+
- ``GET orgs/{org_slug}/alerts``
|
|
1664
|
+
- ``alerts:list``
|
|
1665
|
+
* - ``alerttypes.get()``
|
|
1666
|
+
- ``POST alert-types``
|
|
1667
|
+
- none
|
|
1668
|
+
* - ``analytics.get_org()``
|
|
1669
|
+
- ``GET analytics/org/{filter}``. Deprecated
|
|
1670
|
+
- ``report:write``
|
|
1671
|
+
* - ``analytics.get_repo()``
|
|
1672
|
+
- ``GET analytics/repo/{name}/{filter}``. Deprecated
|
|
1673
|
+
- ``report:write``
|
|
1674
|
+
* - ``apitokens.create()``
|
|
1675
|
+
- ``POST orgs/{org_slug}/api-tokens``
|
|
1676
|
+
- ``api-tokens:create``
|
|
1677
|
+
* - ``apitokens.list()``
|
|
1678
|
+
- ``GET orgs/{org_slug}/api-tokens``
|
|
1679
|
+
- ``api-tokens:list``
|
|
1680
|
+
* - ``apitokens.update()``
|
|
1681
|
+
- ``POST orgs/{org_slug}/api-tokens/update``
|
|
1682
|
+
- ``api-tokens:create``
|
|
1683
|
+
* - ``apitokens.update(token_id=...)``
|
|
1684
|
+
- ``PUT orgs/{org_slug}/api-tokens/{token_id}``
|
|
1685
|
+
- no such route; the call fails
|
|
1686
|
+
* - ``apitokens.rotate()``
|
|
1687
|
+
- ``POST orgs/{org_slug}/api-tokens/rotate``
|
|
1688
|
+
- ``api-tokens:rotate``
|
|
1689
|
+
* - ``apitokens.revoke()``
|
|
1690
|
+
- ``POST orgs/{org_slug}/api-tokens/revoke``
|
|
1691
|
+
- ``api-tokens:revoke``
|
|
1692
|
+
* - ``auditlog.get()``
|
|
1693
|
+
- ``GET orgs/{org_slug}/audit-log``
|
|
1694
|
+
- ``audit-log:list``
|
|
1695
|
+
* - ``basics.get_config()``
|
|
1696
|
+
- ``GET orgs/{org_slug}/settings/socket-basics``
|
|
1697
|
+
- ``socket-basics:read``
|
|
1698
|
+
* - ``dependencies.post()``
|
|
1699
|
+
- ``POST dependencies/upload``. Deprecated
|
|
1700
|
+
- ``report:write``
|
|
1701
|
+
* - ``dependencies.get()``
|
|
1702
|
+
- ``POST dependencies/search``
|
|
1703
|
+
- none; ``dependencies:list`` to get results (see the note above)
|
|
1704
|
+
* - ``dependencies.get(org_slug, ecosystem, package, version)``
|
|
1705
|
+
- ``GET orgs/{org_slug}/dependencies/{ecosystem}/{package}/{version}``
|
|
1706
|
+
- no such route; the call fails
|
|
1707
|
+
* - ``diffscans.list()``
|
|
1708
|
+
- ``GET orgs/{org_slug}/diff-scans``
|
|
1709
|
+
- ``diff-scans:list``
|
|
1710
|
+
* - ``diffscans.get()``
|
|
1711
|
+
- ``GET orgs/{org_slug}/diff-scans/{diff_scan_id}``
|
|
1712
|
+
- ``diff-scans:list``
|
|
1713
|
+
* - ``diffscans.create_from_repo()``
|
|
1714
|
+
- ``POST orgs/{org_slug}/diff-scans/from-repo/{repo_slug}``
|
|
1715
|
+
- ``diff-scans:create``, ``full-scans:create`` and ``repo:list``
|
|
1716
|
+
* - ``diffscans.create_from_ids()``
|
|
1717
|
+
- ``POST orgs/{org_slug}/diff-scans/from-ids``
|
|
1718
|
+
- ``diff-scans:create`` and ``full-scans:list``
|
|
1719
|
+
* - ``diffscans.gfm()``
|
|
1720
|
+
- ``GET orgs/{org_slug}/diff-scans/{diff_scan_id}/gfm``. Deprecated
|
|
1721
|
+
- ``diff-scans:list``
|
|
1722
|
+
* - ``diffscans.delete()``
|
|
1723
|
+
- ``DELETE orgs/{org_slug}/diff-scans/{diff_scan_id}``
|
|
1724
|
+
- ``diff-scans:delete``
|
|
1725
|
+
* - ``export.cdx_bom()``
|
|
1726
|
+
- ``GET orgs/{org_slug}/export/cdx/{id}``
|
|
1727
|
+
- ``report:read``
|
|
1728
|
+
* - ``export.spdx_bom()``
|
|
1729
|
+
- ``GET orgs/{org_slug}/export/spdx/{id}``
|
|
1730
|
+
- ``report:read``
|
|
1731
|
+
* - ``export.openvex_bom()``
|
|
1732
|
+
- ``GET orgs/{org_slug}/export/openvex/{id}``
|
|
1733
|
+
- ``report:read``
|
|
1734
|
+
* - ``fixes.get()``
|
|
1735
|
+
- ``GET orgs/{org_slug}/fixes``. Deprecated
|
|
1736
|
+
- ``fixes:list``
|
|
1737
|
+
* - ``fullscans.get()``
|
|
1738
|
+
- ``GET orgs/{org_slug}/full-scans``, or ``GET orgs/{org_slug}/full-scans/{full_scan_id}`` when ``params`` holds only ``id``
|
|
1739
|
+
- ``full-scans:list``
|
|
1740
|
+
* - ``fullscans.post()``
|
|
1741
|
+
- ``POST orgs/{org_slug}/full-scans``
|
|
1742
|
+
- ``full-scans:create``
|
|
1743
|
+
* - ``fullscans.delete()``
|
|
1744
|
+
- ``DELETE orgs/{org_slug}/full-scans/{full_scan_id}``
|
|
1745
|
+
- ``full-scans:delete``
|
|
1746
|
+
* - ``fullscans.stream_diff()``
|
|
1747
|
+
- ``GET orgs/{org_slug}/full-scans/diff``. Deprecated
|
|
1748
|
+
- ``full-scans:list``
|
|
1749
|
+
* - ``fullscans.stream()``
|
|
1750
|
+
- ``GET orgs/{org_slug}/full-scans/{full_scan_id}``
|
|
1751
|
+
- ``full-scans:list``
|
|
1752
|
+
* - ``fullscans.metadata()``
|
|
1753
|
+
- ``GET orgs/{org_slug}/full-scans/{full_scan_id}/metadata``
|
|
1754
|
+
- ``full-scans:list``
|
|
1755
|
+
* - ``fullscans.gfm()``
|
|
1756
|
+
- ``GET orgs/{org_slug}/full-scans/diff/gfm``. Deprecated
|
|
1757
|
+
- ``full-scans:list``
|
|
1758
|
+
* - ``fullscans.finalize_tier1()``
|
|
1759
|
+
- ``POST tier1-reachability-scan/finalize``
|
|
1760
|
+
- ``full-scans:create`` (not in the API reference)
|
|
1761
|
+
* - ``fullscans.archive()``
|
|
1762
|
+
- ``POST orgs/{org_slug}/full-scans/archive``
|
|
1763
|
+
- ``full-scans:create``
|
|
1764
|
+
* - ``fullscans.rescan()``
|
|
1765
|
+
- ``POST orgs/{org_slug}/full-scans/{full_scan_id}/rescan``
|
|
1766
|
+
- ``full-scans:create``
|
|
1767
|
+
* - ``fullscans.get_tar_files()``
|
|
1768
|
+
- ``GET orgs/{org_slug}/full-scans/{full_scan_id}/files/tar``
|
|
1769
|
+
- ``full-scans:list``
|
|
1770
|
+
* - ``historical.list()``
|
|
1771
|
+
- ``GET orgs/{org_slug}/historical/alerts``
|
|
1772
|
+
- ``historical:alerts-list``
|
|
1773
|
+
* - ``historical.trend()``
|
|
1774
|
+
- ``GET orgs/{org_slug}/historical/alerts/trend``
|
|
1775
|
+
- ``historical:alerts-trend``
|
|
1776
|
+
* - ``historical.dependencies_trend()``
|
|
1777
|
+
- ``GET orgs/{org_slug}/historical/dependencies/trend``
|
|
1778
|
+
- ``historical:dependencies-trend``
|
|
1779
|
+
* - ``historical.snapshots.create()``
|
|
1780
|
+
- ``POST orgs/{org_slug}/historical/snapshots``
|
|
1781
|
+
- ``historical:snapshots-start``
|
|
1782
|
+
* - ``historical.snapshots.list()``
|
|
1783
|
+
- ``GET orgs/{org_slug}/historical/snapshots``
|
|
1784
|
+
- ``historical:snapshots-list``
|
|
1785
|
+
* - ``labels.list()``
|
|
1786
|
+
- ``GET orgs/{org_slug}/repos/labels``
|
|
1787
|
+
- ``repo-label:list``
|
|
1788
|
+
* - ``labels.post()``
|
|
1789
|
+
- ``POST orgs/{org_slug}/repos/labels``
|
|
1790
|
+
- ``repo-label:create``
|
|
1791
|
+
* - ``labels.get()``
|
|
1792
|
+
- ``GET orgs/{org_slug}/repos/labels/{label_id}``
|
|
1793
|
+
- ``repo-label:list``
|
|
1794
|
+
* - ``labels.delete()``
|
|
1795
|
+
- ``DELETE orgs/{org_slug}/repos/labels/{label_id}``
|
|
1796
|
+
- ``repo-label:delete``
|
|
1797
|
+
* - ``labels.associate()``
|
|
1798
|
+
- ``POST orgs/{org_slug}/repos/labels/{label_id}/associate``
|
|
1799
|
+
- ``repo-label:update``
|
|
1800
|
+
* - ``labels.disassociate()``
|
|
1801
|
+
- ``POST orgs/{org_slug}/repos/labels/{label_id}/disassociate``
|
|
1802
|
+
- ``repo-label:update``
|
|
1803
|
+
* - ``labels.setting.get()``
|
|
1804
|
+
- ``GET orgs/{org_slug}/repos/labels/{label_id}/label-setting``
|
|
1805
|
+
- ``repo-label:list``
|
|
1806
|
+
* - ``labels.setting.put()``
|
|
1807
|
+
- ``PUT orgs/{org_slug}/repos/labels/{label_id}/label-setting``
|
|
1808
|
+
- ``repo-label:update``
|
|
1809
|
+
* - ``labels.setting.delete()``
|
|
1810
|
+
- ``DELETE orgs/{org_slug}/repos/labels/{label_id}/label-setting``
|
|
1811
|
+
- ``repo-label:update``
|
|
1812
|
+
* - ``licensemetadata.post()``
|
|
1813
|
+
- ``POST license-metadata``
|
|
1814
|
+
- none
|
|
1815
|
+
* - ``npm.issues()``
|
|
1816
|
+
- ``GET npm/{package}/{version}/issues``. Deprecated
|
|
1817
|
+
- none
|
|
1818
|
+
* - ``npm.score()``
|
|
1819
|
+
- ``GET npm/{package}/{version}/score``. Deprecated
|
|
1820
|
+
- none
|
|
1821
|
+
* - ``openapi.get()``
|
|
1822
|
+
- ``GET openapi``
|
|
1823
|
+
- none
|
|
1824
|
+
* - ``org.get()``
|
|
1825
|
+
- ``GET organizations``
|
|
1826
|
+
- none
|
|
1827
|
+
* - ``purl.post(org_slug=...)``
|
|
1828
|
+
- ``POST orgs/{org_slug}/purl``
|
|
1829
|
+
- ``packages:list``
|
|
1830
|
+
* - ``purl.post()``
|
|
1831
|
+
- ``POST purl``. Deprecated
|
|
1832
|
+
- ``packages:list``
|
|
1833
|
+
* - ``quota.get()``
|
|
1834
|
+
- ``GET quota``
|
|
1835
|
+
- none
|
|
1836
|
+
* - ``report.list()``
|
|
1837
|
+
- ``GET report/list``. Deprecated
|
|
1838
|
+
- ``report:list``
|
|
1839
|
+
* - ``report.delete()``
|
|
1840
|
+
- ``DELETE report/delete/{id}``. Deprecated
|
|
1841
|
+
- ``report:write``
|
|
1842
|
+
* - ``report.view()``
|
|
1843
|
+
- ``GET report/view/{id}``. Deprecated
|
|
1844
|
+
- ``report:read``
|
|
1845
|
+
* - ``report.supported()``
|
|
1846
|
+
- ``GET report/supported``. Deprecated
|
|
1847
|
+
- none
|
|
1848
|
+
* - ``report.create()``
|
|
1849
|
+
- ``PUT report/upload``. Deprecated
|
|
1850
|
+
- ``report:write``
|
|
1851
|
+
* - ``repos.get()``
|
|
1852
|
+
- ``GET orgs/{org_slug}/repos``
|
|
1853
|
+
- ``repo:list``
|
|
1854
|
+
* - ``repos.repo()``
|
|
1855
|
+
- ``GET orgs/{org_slug}/repos/{repo_slug}``
|
|
1856
|
+
- ``repo:list``
|
|
1857
|
+
* - ``repos.post()``
|
|
1858
|
+
- ``POST orgs/{org_slug}/repos``
|
|
1859
|
+
- ``repo:create``
|
|
1860
|
+
* - ``repos.update()``
|
|
1861
|
+
- ``POST orgs/{org_slug}/repos/{repo_slug}``
|
|
1862
|
+
- ``repo:update``
|
|
1863
|
+
* - ``repos.delete()``
|
|
1864
|
+
- ``DELETE orgs/{org_slug}/repos/{repo_slug}``
|
|
1865
|
+
- ``repo:delete``
|
|
1866
|
+
* - ``repositories.list()``
|
|
1867
|
+
- ``GET repos``
|
|
1868
|
+
- no such route; the call fails
|
|
1869
|
+
* - ``sbom.view()``
|
|
1870
|
+
- ``GET sbom/view/{id}``
|
|
1871
|
+
- ``report:read`` (not in the API reference)
|
|
1872
|
+
* - ``settings.get()``
|
|
1873
|
+
- ``GET orgs/{org_slug}/settings/security-policy``
|
|
1874
|
+
- ``security-policy:read``
|
|
1875
|
+
* - ``settings.update_security_policy()``
|
|
1876
|
+
- ``POST orgs/{org_slug}/settings/security-policy``
|
|
1877
|
+
- ``security-policy:update``
|
|
1878
|
+
* - ``settings.get_license_policy()``
|
|
1879
|
+
- ``GET orgs/{org_slug}/settings/license-policy``. Deprecated
|
|
1880
|
+
- ``license-policy:read``
|
|
1881
|
+
* - ``settings.update_license_policy()``
|
|
1882
|
+
- ``POST orgs/{org_slug}/settings/license-policy``
|
|
1883
|
+
- ``license-policy:update``
|
|
1884
|
+
* - ``settings.integration_events()``
|
|
1885
|
+
- ``GET orgs/{org_slug}/settings/integrations/{integration_id}/events``
|
|
1886
|
+
- ``integration:list``
|
|
1887
|
+
* - ``supportedfiles.get()``
|
|
1888
|
+
- ``GET orgs/{org_slug}/supported-files``
|
|
1889
|
+
- none
|
|
1890
|
+
* - ``telemetry.get_config()``
|
|
1891
|
+
- ``GET orgs/{org_slug}/telemetry/config``
|
|
1892
|
+
- none
|
|
1893
|
+
* - ``telemetry.update_config()``
|
|
1894
|
+
- ``PUT orgs/{org_slug}/telemetry/config``
|
|
1895
|
+
- ``telemetry-policy:update``
|
|
1896
|
+
* - ``threatfeed.get(org_slug)``
|
|
1897
|
+
- ``GET orgs/{org_slug}/threat-feed``
|
|
1898
|
+
- ``threat-feed:list``
|
|
1899
|
+
* - ``threatfeed.get()``
|
|
1900
|
+
- ``GET threat-feed``. Deprecated
|
|
1901
|
+
- ``threat-feed:list``
|
|
1902
|
+
* - ``triage.list_alert_triage()``
|
|
1903
|
+
- ``GET orgs/{org_slug}/triage/alerts``
|
|
1904
|
+
- ``triage:alerts-list``
|
|
1905
|
+
* - ``triage.update_alert_triage()``
|
|
1906
|
+
- ``POST orgs/{org_slug}/triage/alerts``
|
|
1907
|
+
- ``triage:alerts-update``
|
|
1908
|
+
* - ``uploadmanifests.upload_manifest_files()``
|
|
1909
|
+
- ``POST orgs/{org_slug}/upload-manifest-files``
|
|
1910
|
+
- ``full-scans:create`` (not in the API reference)
|
|
1911
|
+
* - ``webhooks.list()``
|
|
1912
|
+
- ``GET orgs/{org_slug}/webhooks``
|
|
1913
|
+
- ``webhooks:list``
|
|
1914
|
+
* - ``webhooks.create()``
|
|
1915
|
+
- ``POST orgs/{org_slug}/webhooks``
|
|
1916
|
+
- ``webhooks:create``
|
|
1917
|
+
* - ``webhooks.get()``
|
|
1918
|
+
- ``GET orgs/{org_slug}/webhooks/{webhook_id}``
|
|
1919
|
+
- ``webhooks:list``
|
|
1920
|
+
* - ``webhooks.update()``
|
|
1921
|
+
- ``PUT orgs/{org_slug}/webhooks/{webhook_id}``
|
|
1922
|
+
- ``webhooks:update``
|
|
1923
|
+
* - ``webhooks.delete()``
|
|
1924
|
+
- ``DELETE orgs/{org_slug}/webhooks/{webhook_id}``
|
|
1925
|
+
- ``webhooks:delete``
|