Skip to main content

Python SDK foundation for TrustPlane Auth request material and local Ed25519 signing

Project description

TrustPlane Auth SDK for Python

Caller-side Python SDK for TrustPlane Auth.

The source API supports CLI-compatible Ed25519 keys and passports, transcript-v1 signing, active Control key-grant profiles, arbitrary HTTP methods, TA-G1 public auto-enrollment, and broker IPC v1. Published packages can lag source changes; pin a verified release or use a local checkout for unreleased APIs.

Install

Install a verified release with an explicit package version:

python -m pip install trustplane-auth-sdk==0.2.2

Signed request from a key grant

from trustplane_auth import (
    ProtectedClient,
    SigningProfile,
    private_key_from_base64url,
)

profile = SigningProfile.from_control(control_signing_profile_json)
private_key = private_key_from_base64url(private_key_file_contents.strip())
client = ProtectedClient(profile, private_key)

response = client.request(
    profile.method,
    "/orders/123?expand=items",
    headers={"Accept": "application/json"},
)

Each request receives a fresh short-lived passport/JTI, nonce, canonical body/query/header digest, and proof. The client rejects a method or path outside the active profile, including sibling-prefix mistakes. Parameterized profiles require a concrete path (/orders/123, not /orders/{id}); encoded or ambiguous paths fail closed, query-only targets retain a literal profile path, and redirects are not followed with TrustPlane credentials.

Auto-enrollment

from trustplane_auth import EnrollmentClient, EnrollmentOptions, jwt_enrollment_proof

result = EnrollmentClient().enroll(
    EnrollmentOptions(
        control_url="https://control.example",
        enrollment_policy_ref="enrpol_...",
        provider="kubernetes_service_account_oidc",
        private_key=private_key,
        proof_provider=lambda challenge: jwt_enrollment_proof(
            obtain_audience_bound_token(challenge.expected_audience)
        ),
    )
)

The SDK validates Control's immutable source revision, Azure proof mode when applicable, and required encoding before invoking the proof callback. Helpers also build AWS IID and Azure IMDS attested-document proof values. The safe result never contains proof, key, nonce, signature, or poll capability material. Enrollment requires HTTPS.

Provider credential acquisition stays in the application callback so it can use the host's projected token, CI, SPIFFE, or cloud metadata client. The SDK owns the complete Control protocol. Once a submission is accepted, a polling deadline returns a safe pending result with the request ID instead of resubmitting the proof.

Broker mode

build_broker_request, BrokerClient.issue, and broker_headers provide the caller side of broker IPC v1 over a Unix socket. This package does not include the broker runtime.

Scope boundary

This package does not embed a verifier, adapter, policy engine, SPIFFE issuer, deployment logic, Control administrative API, or CLI-only bundle/local-demo commands.

Raw local signing is software-only. Stronger signer classes must be fulfilled by an appropriate broker or signer; they are never simulated with an exportable key.

Project details


Download files

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

Source Distribution

trustplane_auth_sdk-0.2.2.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

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

trustplane_auth_sdk-0.2.2-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file trustplane_auth_sdk-0.2.2.tar.gz.

File metadata

  • Download URL: trustplane_auth_sdk-0.2.2.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for trustplane_auth_sdk-0.2.2.tar.gz
Algorithm Hash digest
SHA256 482fc99be8f074b28b815e9de939fd28802ed2f1e73381b03612df85447cab5f
MD5 a1ee7e89e4b35f2601009badaef02e39
BLAKE2b-256 24daa88347252ffef5168ea985d11955199338560af2955c11d3657a348d59d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for trustplane_auth_sdk-0.2.2.tar.gz:

Publisher: release-pypi.yml on trustplane-dev/trustplane-auth-sdk-python

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

File details

Details for the file trustplane_auth_sdk-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for trustplane_auth_sdk-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c2f3ecf09f4b0e5f13d0fbd7927f77f180434806ea80e1e0886638b8b4b6a3dc
MD5 447c86524e74fb096238bf8f2d5d44bd
BLAKE2b-256 11e9131a70380f729e77ab722111eb86bc4042601c4ee779a397f7f64a7339b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for trustplane_auth_sdk-0.2.2-py3-none-any.whl:

Publisher: release-pypi.yml on trustplane-dev/trustplane-auth-sdk-python

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

Supported by

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