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 Distributions

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

tng_sdk-2.7.3-py3-none-win_amd64.whl (30.3 MB view details)

Uploaded Python 3Windows x86-64

tng_sdk-2.7.3-py3-none-manylinux_2_17_x86_64.whl (26.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

tng_sdk-2.7.3-py3-none-manylinux_2_17_aarch64.whl (24.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

tng_sdk-2.7.3-py3-none-macosx_11_0_x86_64.whl (28.8 MB view details)

Uploaded Python 3macOS 11.0+ x86-64

tng_sdk-2.7.3-py3-none-macosx_11_0_arm64.whl (27.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file tng_sdk-2.7.3-py3-none-win_amd64.whl.

File metadata

  • Download URL: tng_sdk-2.7.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 30.3 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tng_sdk-2.7.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 04021d550fa08e382e39b7a5d8dc8202024b698959ea844d92beb4379a379f35
MD5 2955897c552d5b78ff88b9e55615bb1e
BLAKE2b-256 8d514e9e1f66ded4a4eb38804e4673565ee8e90c99c5363764559e3499c466c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for tng_sdk-2.7.3-py3-none-win_amd64.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.

File details

Details for the file tng_sdk-2.7.3-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for tng_sdk-2.7.3-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7902e4ece08f1f4935633f275406f4b1fb2881dd2175832e628bd85116116009
MD5 b1812c9edd10964c56cf7cf49c8e6145
BLAKE2b-256 be65bf5ab066b058f569c93222511ecdc5e253799761e625e440ac11dcd4035a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tng_sdk-2.7.3-py3-none-manylinux_2_17_x86_64.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.

File details

Details for the file tng_sdk-2.7.3-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for tng_sdk-2.7.3-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 13dd773212c4c61276024f58d975e05c53a79b4f54a2f6e135964dd9d0c678f0
MD5 f128d120c838b2828e40fe62a8de2a5b
BLAKE2b-256 363e2f4a350f2ca82903fe0470cf04a647eda2ecbbd2ac6de93de1ac676c5500

See more details on using hashes here.

Provenance

The following attestation bundles were made for tng_sdk-2.7.3-py3-none-manylinux_2_17_aarch64.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.

File details

Details for the file tng_sdk-2.7.3-py3-none-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for tng_sdk-2.7.3-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 063ec2e5d0438b40e3e549debcd898551463e3e33de88e29ef25846771710efb
MD5 818be3e3080a69079ffc21781240fa72
BLAKE2b-256 b20bdae8ff2475c716fbe1a8aa662290580619dd965d42a365d8837f1ae5c1c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for tng_sdk-2.7.3-py3-none-macosx_11_0_x86_64.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.

File details

Details for the file tng_sdk-2.7.3-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tng_sdk-2.7.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 013356703ff336923ee1e570cd0f0a31e63e0b4ea28c8c6b90c129d82282ca24
MD5 73dcd2f8b8b94b92c5510ee0af6cab6f
BLAKE2b-256 ac481db5f54d7992f48115849cce6c9d3a04418d2ef5ab468258905dce4d0a0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tng_sdk-2.7.3-py3-none-macosx_11_0_arm64.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

This release

2.7.3 This release

5 files

2.7.2

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