Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ from libtea import TeaClient
# Auto-discover the sbomify TEA server from its .well-known/tea
with TeaClient.from_well_known("trust.sbomify.com") as client:
# Discover a product by TEI
results = client.discover(
"urn:tei:purl:trust.sbomify.com:pkg:github/sbomify/sbomify"
)
results = client.discover("urn:tei:purl:trust.sbomify.com:pkg:github/sbomify/sbomify")
for info in results:
print(info.product_release_uuid, info.servers)

Expand Down Expand Up @@ -102,9 +100,7 @@ from libtea import TeaClient

# Discover sbomify products via TEI
with TeaClient.from_well_known("trust.sbomify.com") as client:
results = client.discover(
"urn:tei:purl:trust.sbomify.com:pkg:github/sbomify/sbomify"
)
results = client.discover("urn:tei:purl:trust.sbomify.com:pkg:github/sbomify/sbomify")
for info in results:
print(info.product_release_uuid, info.servers)
```
Expand All @@ -115,9 +111,7 @@ Low-level discovery functions are also available:
from libtea.discovery import parse_tei, fetch_well_known, select_endpoint

# Parse a TEI URN
tei_type, domain, identifier = parse_tei(
"urn:tei:purl:trust.sbomify.com:pkg:github/sbomify/sbomify"
)
tei_type, domain, identifier = parse_tei("urn:tei:purl:trust.sbomify.com:pkg:github/sbomify/sbomify")

# Fetch and select an endpoint manually
well_known = fetch_well_known("trust.sbomify.com")
Expand All @@ -138,8 +132,10 @@ with TeaClient.from_well_known("trust.sbomify.com") as client:

# Search product releases (with pagination)
releases = client.search_product_releases(
"PURL", "pkg:github/sbomify/sbomify",
page_offset=0, page_size=100,
"PURL",
"pkg:github/sbomify/sbomify",
page_offset=0,
page_size=100,
)
print(releases.total_results)
```
Expand Down Expand Up @@ -322,6 +318,7 @@ Use the `TeaClientProtocol` for dependency inversion in consumer code:
```python
from libtea import TeaClientProtocol


def fetch_sbom(client: TeaClientProtocol, product_uuid: str):
"""Accepts any object matching the TeaClient interface."""
product = client.get_product(product_uuid)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dev = [
"pytest>=9.0.0,<10",
"pytest-cov>=7.0.0,<8",
"pytest-timeout>=2.3.0,<3",
"ruff>=0.15.0,<0.16",
"ruff>=0.15.0,<0.17",
"pre-commit>=4.5.0,<5",
"responses>=0.26.0,<1",
"mypy>=1.15.0,<3",
Expand Down
Loading
Loading