Skip to main content

TNG Python SDK

PyPI

中文文档

Trusted Network Gateway (TNG) Python SDK — encrypted HTTP requests with remote attestation.

Quick Start

pip install tng-sdk
from tng import Tng
import requests

# Create TNG client (no_ra = disable remote attestation for testing)
tng = Tng(no_ra=True)

# Wrap a requests session
session = requests.Session()
tng.wrap_requests(session)

# All requests flow through the encrypted TNG tunnel
resp = session.get("http://tng-server:10001/api/data")
print(resp.json())

tng.close()

Supported Clients

Client Method
requests tng.wrap_requests(session)
httpx tng.wrap_httpx(client)
openai tng.wrap_openai(client)

Security Options

# Disable remote attestation (testing only)
tng = Tng(no_ra=True)

# With verifier
tng = Tng(verify={"as_addr": "http://127.0.0.1:8080/", "policy_ids": ["default"]})

# With attester
tng = Tng(attest={"aa_addr": "unix:///run/aa.sock", "model": "passport"})

# Bidirectional attestation
tng = Tng(
    attest={"aa_addr": "unix:///run/aa.sock"},
    verify={"as_addr": "http://127.0.0.1:8080/", "policy_ids": ["default"]}
)

Encryption Protocol

# OHTTP is the default
tng = Tng(no_ra=True)

# Use rats-TLS instead of OHTTP (mutually exclusive)
tng = Tng(no_ra=True, rats_tls={"multiplex": True})

Documentation

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tng_sdk-2.7.2-py3-none-any.whl (26.1 MB view details)

Uploaded Python 3

File details

Details for the file tng_sdk-2.7.2-py3-none-any.whl.

File metadata

  • Download URL: tng_sdk-2.7.2-py3-none-any.whl
  • Upload date:
  • Size: 26.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tng_sdk-2.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b2fbb71a59365f9d832c39e2959eb691b3dec01ac2d8b5ceac18548d759a7d90
MD5 a827729d65112f972087df81a6bb944a
BLAKE2b-256 9323886b638416517668554612d63bfef10c3d9e5591dc733486b5ec34e4e77f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tng_sdk-2.7.2-py3-none-any.whl:

Publisher: build-python-sdk.yml on inclavare-containers/TNG

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.8.0

5 files

2.7.3

5 files

This release

2.7.2 This release

1 file

2.7.1

1 file

2.7.0

1 file

2.6.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page