socketdev 3.6.1__py3-none-any.whl → 3.6.3__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/__init__.py CHANGED
@@ -1,5 +1,7 @@
1
1
  import os
2
2
  from socketdev.core.api import API
3
+ from socketdev.core.retired_token import reject_retired_token
4
+ from socketdev.core.token_selection import select_token
3
5
  from socketdev.dependencies import Dependencies
4
6
  from socketdev.diffscans import DiffScans
5
7
  from socketdev.export import Export
@@ -53,21 +55,15 @@ request_timeout = 1200
53
55
 
54
56
  class socketdev:
55
57
  def __init__(self, token: Optional[str] = None, timeout: int = 1200, allow_unverified: bool = False, user_agent: Optional[str] = None):
56
- # Try to get token from environment variables if not provided
57
- if token is None:
58
- token = (
59
- os.getenv("SOCKET_SECURITY_API_TOKEN") or
60
- os.getenv("SOCKET_SECURITY_API_KEY") or
61
- os.getenv("SOCKET_API_KEY") or
62
- os.getenv("SOCKET_API_TOKEN")
63
- )
64
-
58
+ token = select_token(token, os.environ)
65
59
  if token is None:
66
60
  raise ValueError(
67
61
  "API token is required. Provide it as a parameter or set one of these environment variables: "
68
62
  "SOCKET_SECURITY_API_TOKEN, SOCKET_SECURITY_API_KEY, SOCKET_API_KEY, SOCKET_API_TOKEN"
69
63
  )
70
64
 
65
+ reject_retired_token(token)
66
+
71
67
  self.api = API()
72
68
  self.token = token + ":"
73
69
  self.api.encode_key(self.token)
socketdev/core/api.py CHANGED
@@ -1,5 +1,7 @@
1
1
  import base64
2
+ from typing import Optional
2
3
  from socketdev.log import log
4
+ from socketdev.core.retired_token import reject_retired_basic_auth_token
3
5
 
4
6
  import requests
5
7
  from socketdev.core.classes import Response
@@ -29,6 +31,7 @@ class API:
29
31
  self.user_agent = None
30
32
 
31
33
  def encode_key(self, token: str):
34
+ reject_retired_basic_auth_token(token)
32
35
  self.encoded_key = base64.b64encode(token.encode()).decode("ascii")
33
36
 
34
37
  def set_timeout(self, timeout: int):
@@ -47,6 +50,8 @@ class API:
47
50
  payload: [dict, str] = None,
48
51
  files: list = None,
49
52
  method: str = "GET",
53
+ *,
54
+ request_timeout: Optional[float] = None,
50
55
  ) -> Response:
51
56
  if self.encoded_key is None or self.encoded_key == "":
52
57
  raise APIKeyMissing
@@ -68,7 +73,8 @@ class API:
68
73
 
69
74
  response = requests.request(
70
75
  method.upper(), url, headers=headers, data=payload, files=files,
71
- timeout=self.request_timeout, verify=not self.allow_unverified
76
+ timeout=self.request_timeout if request_timeout is None else request_timeout,
77
+ verify=not self.allow_unverified
72
78
  )
73
79
  request_duration = time.time() - start_time
74
80
 
@@ -0,0 +1,34 @@
1
+ import hashlib
2
+ import hmac
3
+ from typing import Optional
4
+
5
+ RETIRED_TOKEN_SHA256 = "9cab58b24140ee12c08e265729d246f9200f8ef9b1d884f90c06c4e6b69adf18"
6
+ RETIRED_TOKEN_ERROR = (
7
+ "This API token has been retired. Create a new API token in Socket "
8
+ "and update your configuration."
9
+ )
10
+
11
+
12
+ # Fingerprint identifies a retired credential; it is not a password verifier.
13
+ def _matches_retired_digest(token: Optional[str], digest: str) -> bool:
14
+ if token is None:
15
+ return False
16
+ token_digest = hashlib.sha256(token.strip().encode("utf-8")).hexdigest()
17
+ return hmac.compare_digest(token_digest, digest)
18
+
19
+
20
+ def _reject_retired_token(token: Optional[str], digest: str) -> None:
21
+ if _matches_retired_digest(token, digest):
22
+ raise ValueError(RETIRED_TOKEN_ERROR)
23
+
24
+
25
+ def _reject_basic_auth_token(token: str, digest: str) -> None:
26
+ _reject_retired_token(token.partition(":")[0], digest)
27
+
28
+
29
+ def reject_retired_token(token: Optional[str]) -> None:
30
+ _reject_retired_token(token, RETIRED_TOKEN_SHA256)
31
+
32
+
33
+ def reject_retired_basic_auth_token(token: str) -> None:
34
+ _reject_basic_auth_token(token, RETIRED_TOKEN_SHA256)
@@ -0,0 +1,19 @@
1
+ from typing import Mapping, Optional
2
+
3
+ TOKEN_ENVIRONMENT_VARIABLES = (
4
+ "SOCKET_SECURITY_API_TOKEN",
5
+ "SOCKET_SECURITY_API_KEY",
6
+ "SOCKET_API_KEY",
7
+ "SOCKET_API_TOKEN",
8
+ )
9
+
10
+
11
+ def select_token(
12
+ explicit_token: Optional[str], environment: Mapping[str, str]
13
+ ) -> Optional[str]:
14
+ if explicit_token is not None:
15
+ return explicit_token
16
+ return next(
17
+ (environment[name] for name in TOKEN_ENVIRONMENT_VARIABLES if environment.get(name)),
18
+ None,
19
+ )
@@ -4,9 +4,12 @@ from enum import Enum
4
4
  from typing import Any, Dict, List, Optional, Union
5
5
  from dataclasses import dataclass, asdict, field
6
6
  import urllib.parse
7
+ import math
8
+ import time
7
9
  from ..core.dedupe import Dedupe
8
10
  from ..core.enums import unknown_enum_value
9
11
  from ..utils import IntegrationType, Utils
12
+ from ..exceptions import APIFailure, APITimeout
10
13
 
11
14
  log = logging.getLogger("socketdev")
12
15
 
@@ -960,15 +963,65 @@ class FullScans:
960
963
  )
961
964
  return {}
962
965
 
963
- def stream(self, org_slug: str, full_scan_id: str, use_types: bool = False) -> Union[dict, FullScanStreamResponse]:
964
- path = "orgs/" + org_slug + "/full-scans/" + full_scan_id
965
- response = self.api.do_request(path=path, method="GET")
966
+ def stream(
967
+ self,
968
+ org_slug: str,
969
+ full_scan_id: str,
970
+ use_types: bool = False,
971
+ *,
972
+ poll_timeout_seconds: Optional[float] = None,
973
+ poll_initial_interval_seconds: float = 5.0,
974
+ poll_max_interval_seconds: float = 10.0,
975
+ ) -> Union[dict, FullScanStreamResponse]:
976
+ request_timeout = self.api.request_timeout
977
+ timeout = request_timeout if poll_timeout_seconds is None else poll_timeout_seconds
978
+ values = (timeout, poll_initial_interval_seconds, poll_max_interval_seconds, request_timeout)
979
+ if any(
980
+ isinstance(value, bool)
981
+ or not isinstance(value, (int, float))
982
+ or not math.isfinite(value)
983
+ or value <= 0
984
+ for value in values
985
+ ):
986
+ raise ValueError("Full scan polling timeout and intervals must be positive finite numbers")
987
+ if poll_initial_interval_seconds > poll_max_interval_seconds:
988
+ raise ValueError("Initial polling interval must not exceed maximum polling interval")
989
+
990
+ path = (
991
+ "orgs/" + urllib.parse.quote(org_slug, safe="") + "/full-scans/"
992
+ + urllib.parse.quote(full_scan_id, safe="") + "?cached=true"
993
+ )
994
+ deadline = time.monotonic() + timeout
995
+ interval = poll_initial_interval_seconds
996
+ while True:
997
+ retry_error = None
998
+ try:
999
+ response = self.api.do_request(
1000
+ path=path,
1001
+ method="GET",
1002
+ request_timeout=min(float(request_timeout), max(deadline - time.monotonic(), 0.001)),
1003
+ )
1004
+ except APIFailure as error:
1005
+ if not error.is_transient_error():
1006
+ raise
1007
+ retry_error = error
1008
+ else:
1009
+ if response.status_code != 202:
1010
+ break
1011
+ response.close()
1012
+ # Give up now if the next attempt could not start before the deadline,
1013
+ # rather than sleeping out the rest of the budget and never polling again.
1014
+ if deadline - time.monotonic() <= interval:
1015
+ raise APITimeout("Timed out waiting for full scan results") from retry_error
1016
+ time.sleep(interval)
1017
+ interval = min(poll_max_interval_seconds, interval * 1.5)
966
1018
 
967
1019
  if response.status_code == 200:
968
1020
  try:
969
1021
  stream_str = []
970
1022
  artifacts = {}
971
1023
  result = response.text
1024
+ response.close()
972
1025
  result = result.strip('"').strip()
973
1026
  for line in result.split("\n"):
974
1027
  if line != '"' and line != "" and line is not None:
@@ -993,6 +1046,7 @@ class FullScans:
993
1046
  return artifacts
994
1047
 
995
1048
  except Exception as e:
1049
+ response.close()
996
1050
  error_message = f"Error parsing stream response: {str(e)}"
997
1051
  log.error(error_message)
998
1052
  if use_types:
@@ -1001,7 +1055,10 @@ class FullScans:
1001
1055
  )
1002
1056
  return {}
1003
1057
 
1004
- error_message = response.json().get("error", {}).get("message", "Unknown error")
1058
+ try:
1059
+ error_message = response.json().get("error", {}).get("message", "Unknown error")
1060
+ finally:
1061
+ response.close()
1005
1062
  log.error(f"Error streaming full scan: {response.status_code}, message: {error_message}")
1006
1063
  if use_types:
1007
1064
  return FullScanStreamResponse.from_dict(
@@ -108,14 +108,17 @@ class Settings:
108
108
  )
109
109
  return {}
110
110
 
111
- def integration_events(self, org_slug: str, integration_id: str) -> dict:
111
+ def integration_events(self, org_slug: str, integration_id: str) -> list:
112
112
  """Get integration events for a specific integration.
113
113
 
114
114
  Args:
115
115
  org_slug: Organization slug
116
116
  integration_id: Integration ID
117
+
118
+ Returns:
119
+ The integration's events, as the list the API returns.
117
120
  """
118
- path = f"orgs/{org_slug}/settings/integrations/{integration_id}"
121
+ path = f"orgs/{org_slug}/settings/integrations/{integration_id}/events"
119
122
  response = self.api.do_request(path=path)
120
123
 
121
124
  if response.status_code == 200:
@@ -123,7 +126,7 @@ class Settings:
123
126
 
124
127
  error_message = response.json().get("error", {}).get("message", "Unknown error")
125
128
  log.error(f"Error getting integration events: {response.status_code}, message: {error_message}")
126
- return {}
129
+ return []
127
130
 
128
131
  def get_license_policy(self, org_slug: str) -> dict:
129
132
  """Get license policy settings for an organization.
socketdev/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "3.6.1"
1
+ __version__ = "3.6.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: socketdev
3
- Version: 3.6.1
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``
@@ -1,7 +1,7 @@
1
- socketdev/__init__.py,sha256=b6HMwupbJY8tCVyvITG6SVOoEntoVjrFrjrBDPOuan8,4369
1
+ socketdev/__init__.py,sha256=4S3ApgU21s_1Wd4bEfife4ifAzmrdzLMS2gvft1a6Vo,4224
2
2
  socketdev/exceptions.py,sha256=yr1O1wkJUi-pvXQuqdAj4phNggHmT2N57I6DOdGdsgI,4225
3
3
  socketdev/log.py,sha256=AgEcsPN3y9U-fze8pTFvLigVvNob2vmNC-TkOOQkkeQ,90
4
- socketdev/version.py,sha256=cNcutCkgy2XbuD3pgQjRV1bl4tH97bFnsC9W8BVzmHE,22
4
+ socketdev/version.py,sha256=Y-FgC1VqJrp0YmwoM9m0nqI9YiRGdYqtfNFOz9j36SQ,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
@@ -9,16 +9,18 @@ socketdev/analytics/__init__.py,sha256=kQGeO67TraqvfmYjfpYCvcNRtxW2a6x5EefEl6Jnc
9
9
  socketdev/apitokens/__init__.py,sha256=Z6W9Jkh4gdDeJBivfcONZuz7jRKZtxWLTi1n9gkbYVE,4222
10
10
  socketdev/auditlog/__init__.py,sha256=vjcVtOK6oujqC6-RW5Hrvmth5BqFkLdinbeyqtycOpA,881
11
11
  socketdev/basics/__init__.py,sha256=9jTEwC4dMUV-9pKpU4twK-hM1cY0xeXAxjDrb37sxoQ,4067
12
- socketdev/core/api.py,sha256=cpHgS6d7rKfUSccoXsr_uKkbB60uSiPLs2pMYDN-9FU,6350
12
+ socketdev/core/api.py,sha256=JROfXLRZ4IZApCpKw5MJFX21NIAdeBwIzU5oWxAC-3g,6622
13
13
  socketdev/core/classes.py,sha256=jY1oyokpSVDA2XckG1pdVOP5PtxDS8CWta8PX6eZFJc,3608
14
14
  socketdev/core/dedupe.py,sha256=Fy_HGU77jxt7Dz8TF7AYkEklwtu_xFA40ripaYyBkqs,5774
15
15
  socketdev/core/enums.py,sha256=daY3vdm4veuYKCWenFOIsGsga85xzkiLfcygb5F1LSk,1416
16
16
  socketdev/core/issues.py,sha256=SKhJz7SrglozeuEk72CbbuCM7X0hgzNMk55uM4wX-TI,68081
17
+ socketdev/core/retired_token.py,sha256=uwPS_1p1e3JzC8yPD3bBVPhhLsqWsTbChorHEdapLMo,1126
18
+ socketdev/core/token_selection.py,sha256=baV-NkykdNeY6_w2CtUNBLfnHeEeAo8B04OzvaMSJ2c,484
17
19
  socketdev/dependencies/__init__.py,sha256=eKxcGjRm8IcW_PGnOyr4QQYOq6TnB4xPjooncdVr03g,2117
18
20
  socketdev/diffscans/__init__.py,sha256=NCvjirhFGWD93miL87UObQ7SeInBEkNt5R28uLIKYi0,7004
19
21
  socketdev/export/__init__.py,sha256=5DqVqHnaK5Aq-ueSTIAplOZJpF21W_pXysIzmMNLGPg,3667
20
22
  socketdev/fixes/__init__.py,sha256=ouRSQ5FcqQcjAmrU8aAgd0ZJeo431wBOEVKLR36etik,856
21
- socketdev/fullscans/__init__.py,sha256=Z6_M6cZ9MllWjHwCmK-SDWWoxyvP7TCNeie-gJbbMKo,40776
23
+ socketdev/fullscans/__init__.py,sha256=YYE-deKBbzaLlBOx3ibUlmxS6lOIB9hWw63lueNq1gw,43059
22
24
  socketdev/historical/__init__.py,sha256=DXFmRrHLWHKbZrB8eermM4YG6j4C1S4Lz6-V63_p2gs,3472
23
25
  socketdev/labels/__init__.py,sha256=Ep19ZraKqi_a-3-eAOWGhPNQsgwGRY9N28Oyxlxrz-g,5128
24
26
  socketdev/licensemetadata/__init__.py,sha256=pDcvpkc08QtMqhsnKP1Cfjvs3m-MRPYUK-uLh8aRkrU,815
@@ -31,7 +33,7 @@ socketdev/report/__init__.py,sha256=5uQQAgeZP_ApOSfUdYizIbYKFaptnIL1_rxRGTkrtus,
31
33
  socketdev/repos/__init__.py,sha256=2_BVRYYpA-wF1W9KvhbaBrfe3g2VHLkWLMizWOiyX3A,5641
32
34
  socketdev/repositories/__init__.py,sha256=nZPaI28geaZWCoMjBZ6ipCFHZpdJNLnznOvdY5OnKlM,759
33
35
  socketdev/sbom/__init__.py,sha256=LpesXKZhgF5OeNWls10YgxsCNamFW-F8UOy4yI11hrY,2341
34
- socketdev/settings/__init__.py,sha256=GpRQDJt2D0TAORjqYAwcWeAmS4WAquFpAElnx6_YCIY,6556
36
+ socketdev/settings/__init__.py,sha256=UPom0BXlJ91wyWqYLLAYiJ19bIwQdPXnJqEQWsnKpzw,6648
35
37
  socketdev/supportedfiles/__init__.py,sha256=XLli-HOPYJrKs0TIHKSD2tk8VSLJsI3owMKeVlGQNms,706
36
38
  socketdev/telemetry/__init__.py,sha256=9cRqeT6ToZVnWv65acMX9TXGgDDNe2VY4ZEf-4ooGHI,1444
37
39
  socketdev/threatfeed/__init__.py,sha256=2SsJYKByXBkb2C1fGopwxejkr7mky0kggFKIunyV7Nk,1119
@@ -40,7 +42,7 @@ socketdev/triage/__init__.py,sha256=-h599vThVetfRSOAs1e4IUoMjcXS8xOsUfub41XPiX4,
40
42
  socketdev/uploadmanifests/__init__.py,sha256=-sFHbOW-aw7U0wRfEJT_Edrzx8aCbzD9cTGmVTNJKpw,6043
41
43
  socketdev/utils/__init__.py,sha256=E11UJTsWsN-ZurOwtKvPGOTc9UMP3ND79nPbmNRRQ6E,17666
42
44
  socketdev/webhooks/__init__.py,sha256=fme6K7ma_Gvk_TFOLz9jVcR5QJbDpMHXqRaU3x_RShY,3507
43
- socketdev-3.6.1.dist-info/METADATA,sha256=bsxs6WpgzdRdR_dpOO3kboWJyZdTsnzcRKwfkxOaedQ,45702
44
- socketdev-3.6.1.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
45
- socketdev-3.6.1.dist-info/licenses/LICENSE,sha256=mC0II_UuE-_gCG9XqOLNyrV3crnROzMpdAetGnMrhpw,1068
46
- socketdev-3.6.1.dist-info/RECORD,,
45
+ socketdev-3.6.3.dist-info/METADATA,sha256=nF3B_mgWWHkrJTCz03BrCjodkkIXDD68aHN2eCki0BU,61607
46
+ socketdev-3.6.3.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
47
+ socketdev-3.6.3.dist-info/licenses/LICENSE,sha256=mC0II_UuE-_gCG9XqOLNyrV3crnROzMpdAetGnMrhpw,1068
48
+ socketdev-3.6.3.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.32.4
2
+ Generator: hatchling 1.33.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any