TNG Python SDK
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
- Getting Started — Complete installation, usage, and configuration guide
- Getting Started (中文) — 完整的安装、使用和配置指南
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
tng_sdk-2.7.1-py3-none-any.whl
(26.1 MB
view details)
File details
Details for the file tng_sdk-2.7.1-py3-none-any.whl.
File metadata
- Download URL: tng_sdk-2.7.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02a7c2dc735450f1fd52a4931c70b450c739c42c6e331a091744f055fd375789
|
|
| MD5 |
f0303effc6ce238e11320a89a70529c0
|
|
| BLAKE2b-256 |
98b66ef07e8ab3202379d767b79b53b5f8bb3ece789f33bb33458c2b57d7c89a
|
Provenance
The following attestation bundles were made for tng_sdk-2.7.1-py3-none-any.whl:
Publisher:
build-python-sdk.yml on inclavare-containers/TNG
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tng_sdk-2.7.1-py3-none-any.whl -
Subject digest:
02a7c2dc735450f1fd52a4931c70b450c739c42c6e331a091744f055fd375789 - Sigstore transparency entry: 2097094812
- Sigstore integration time:
-
Permalink:
inclavare-containers/TNG@f8a85739af59915e3b19390af0e73c42a4efe97e -
Branch / Tag:
refs/tags/v2.7.1 - Owner: https://github.com/inclavare-containers
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-python-sdk.yml@f8a85739af59915e3b19390af0e73c42a4efe97e -
Trigger Event:
push
-
Statement type: