Python SDK foundation for TrustPlane Auth request material and local Ed25519 signing
Project description
TrustPlane Auth SDK for Python
Preview Python caller SDK for TrustPlane Auth request signing.
This package provides caller-side helpers for:
- building
transcript-v1request material - computing body SHA-256 values
- parsing passport claims needed by signing
- raw local Ed25519 software signing
- returning adapter-ready TrustPlane Auth headers
It does not include a verifier, broker, adapter, policy engine, SPIFFE issuer, deployment code, enrollment flow, bundle mutation, or TrustPlane Control API.
Install
Install released preview versions from PyPI with an exact version pin:
python -m pip install trustplane-auth-sdk==0.1.0rc1
For unreleased local changes, test this repository through a local checkout or built wheel.
Package Name
The Python distribution name candidate is trustplane-auth-sdk.
The import module is trustplane_auth:
from trustplane_auth import body_sha256, build_request, sign_request
The package version remains 0.0.0 until the release workflow is introduced.
PyPI trusted publishing is planned in a follow-up.
Build Request Example
from trustplane_auth import SOFTWARE_KEY_BINDING, Header, build_request
material = build_request(
method="POST",
scheme="https",
authority="orders.example",
path="/v1/orders",
audience="orders-api",
route_id="orders.create",
content_encoding="identity",
body=b'{"order_id":"ord_123","amount":"42.00"}',
headers=[
Header(name="Content-Type", value="application/json"),
Header(name="X-TrustPlane-Nonce", value="nonce-v1-001"),
],
header_allow_list=["content-type", "x-trustplane-nonce"],
passport_jti="passport-v1-minimal-001",
nonce="nonce-v1-001",
issued_at_unix=1740000000,
key_binding=SOFTWARE_KEY_BINDING,
)
print(material.transcript_sha256)
Signing Example
Signing requires a real passport whose cnf.key_binding is software and whose cnf.public_key_b64url matches the Ed25519 private key.
from pathlib import Path
from trustplane_auth import Header, sign_request
passport = "header.payload.signature"
private_key_pem = Path("ed25519-private-key.pem").read_bytes()
signed = sign_request(
request={
"method": "POST",
"scheme": "https",
"authority": "orders.example",
"path": "/v1/orders",
"route_id": "orders.create",
"content_encoding": "identity",
"body": b'{"order_id":"ord_123","amount":"42.00"}',
"headers": [
Header(name="Content-Type", value="application/json"),
Header(name="X-TrustPlane-Nonce", value="nonce-v1-001"),
],
"header_allow_list": ["content-type", "x-trustplane-nonce"],
"nonce": "nonce-v1-001",
},
passport_token=passport,
private_key=private_key_pem,
)
headers = signed.headers
sign_request reads passport-bound fields from the passport and fails if caller-supplied consistency checks conflict. It does not infer or repair aud, jti, iat, cnf.kid, cnf.key_binding, or cnf.public_key_b64url from caller request inputs.
Conformance Posture
testdata/conformance/v1 contains public-safe contract vectors copied from the TrustPlane Auth reference. Tests assert exact canonical transcript lines, transcript SHA-256 values, and body SHA-256 values.
Security Rule
This SDK signs only the verifier-rebuilt request transcript. Raw local signing is software-only and requires an Ed25519 private key whose public key exactly matches the passport cnf.public_key_b64url claim.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file trustplane_auth_sdk-0.1.0rc1.tar.gz.
File metadata
- Download URL: trustplane_auth_sdk-0.1.0rc1.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1743adc5419f69b2b51978da059f6556fa618636a81408d5a3d5854614cf4d72
|
|
| MD5 |
0ef834df9db53723b2a985da77d54ccd
|
|
| BLAKE2b-256 |
a8e3d0e4007166bffeb8dd6153d5341789650e9516f5cb847b9768cedc79ba1c
|
Provenance
The following attestation bundles were made for trustplane_auth_sdk-0.1.0rc1.tar.gz:
Publisher:
release-pypi.yml on trustplane-dev/trustplane-auth-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trustplane_auth_sdk-0.1.0rc1.tar.gz -
Subject digest:
1743adc5419f69b2b51978da059f6556fa618636a81408d5a3d5854614cf4d72 - Sigstore transparency entry: 1964180111
- Sigstore integration time:
-
Permalink:
trustplane-dev/trustplane-auth-sdk-python@47a3a33a875ef2ab86eaafe611227e73d57ab599 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/trustplane-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@47a3a33a875ef2ab86eaafe611227e73d57ab599 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file trustplane_auth_sdk-0.1.0rc1-py3-none-any.whl.
File metadata
- Download URL: trustplane_auth_sdk-0.1.0rc1-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
589456b0000d538f04dc5c7b6f230056401e3b6ca0004b0f24afee5228eafcf8
|
|
| MD5 |
f51bb82809dced270f67a2cf4d13178f
|
|
| BLAKE2b-256 |
093069e17dbc9fa0385f3ae16f6f60ad444992c4ebec7128d6fce7dfad8447fe
|
Provenance
The following attestation bundles were made for trustplane_auth_sdk-0.1.0rc1-py3-none-any.whl:
Publisher:
release-pypi.yml on trustplane-dev/trustplane-auth-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trustplane_auth_sdk-0.1.0rc1-py3-none-any.whl -
Subject digest:
589456b0000d538f04dc5c7b6f230056401e3b6ca0004b0f24afee5228eafcf8 - Sigstore transparency entry: 1964180225
- Sigstore integration time:
-
Permalink:
trustplane-dev/trustplane-auth-sdk-python@47a3a33a875ef2ab86eaafe611227e73d57ab599 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/trustplane-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@47a3a33a875ef2ab86eaafe611227e73d57ab599 -
Trigger Event:
workflow_dispatch
-
Statement type: