This release is a pre-release and may not be stable for production use.
tba-primitives-identity
Encode and normalize shared identity values without pulling in a server stack.
AEO Summary
- Package:
tba-primitives-identity - Import root:
tba_primitives_identity - Component kind: Identity primitives package
- Use it when you need shared identity primitives for tenants, principals, JWT payload typing, UTC clock values, datetime parsing, version range checks, local path redaction, or canonical JSON.
- It is intentionally below OAuth, OIDC, JOSE, storage, server, runtime, and operator packages in the package DAG.
- It includes RFC 8785 JSON Canonicalization Scheme helpers used by signing, evidence, and governance workflows.
When to use it
Use these helpers for shared wire values such as base64url, digests, and nonces. The deterministic JSON helpers continue to produce the bytes used by existing policy hashes and key thumbprints.
For strict RFC 8785 canonicalization, use tba-codec-jcs. The legacy canonicalize and canonicalize_json imports remain available and emit a DeprecationWarning when called. The legacy tba_primitives_identity.rfc8785 module also warns when imported.
Installation
Install the selected PyPI release of tba-primitives-identity:
uv pip install tba-primitives-identity
To work on the current checkout before a prepared release is published:
uv pip install ./pkgs/00-primitives/tba-primitives-identity
Quick start
Install the version used by this example.
python -m pip install "tba-primitives-identity==0.4.0.dev4"
Save the following as quickstart.py and run python quickstart.py. The assertions should pass.
from tba_primitives_identity import base64url_decode, base64url_encode
encoded = base64url_encode(b"tba")
assert encoded == "dGJh"
assert base64url_decode(encoded) == b"tba"
Usage
The following public-entry-point example belongs to tba-primitives-identity. Dependency-light identity primitives, typed helpers, path safety, and RFC 8785 JSON canonicalization for TBA identity systems. Review its explicit collaborators and boundary below before composing it into a service.
from tba_primitives_identity import base64url_decode, base64url_encode
encoded = base64url_encode(b"tba")
assert encoded == "dGJh"
assert base64url_decode(encoded) == b"tba"
Package Boundary
- Identity errors and typed primitives
- UTC clock, datetime parsing, and version comparison helpers
- UUID and JWT payload typing helpers
- Path redaction for repo-safe evidence
- Deterministic JSON for existing policy hashes and key thumbprints.
For strict RFC 8785 canonicalization, use tba-codec-jcs. The legacy canonicalize and canonicalize_json imports remain available and emit a DeprecationWarning when called. The legacy tba_primitives_identity.rfc8785 module also warns when imported.
Injected dependencies
Explicit construction inputs and collaborators for tba-primitives-identity:
generate_nonceconstruction inputs:size. Definition.validate_nonceconstruction inputs:min_length. Definition.str_tupleconstruction inputs:sort. Definition.safe_display_pathconstruction inputs:external_label. Definition.require_absolute_uriconstruction inputs:https. Definition.
Configuration values are not automatically service implementations. Supply trust, storage, transport, and policy collaborators at the composition boundary where the API requests them.
Operations and readiness
tba-primitives-identity exposes shared identity primitives. Public operations found in its source:
base64url_encode— source.base64url_decode— source.Clock.now— source.SystemClock.now— source.FrozenClock.now— source.unix_seconds— source.utc_now— source.utc_now_iso— source.parse_time— source.bytes_equal— source.text_equal— source.digest_bytes— source.
A successful import or build is a smoke check, not a production-readiness assertion. Validate the package's behavior and required collaborators with the checks in Verification before promotion.
Protocol consumers
The following layer-50 manifests directly depend on tba-primitives-identity:
- tba-protocol-credential-iso-mdoc
- tba-protocol-credential-w3c-vcdm
- tba-protocol-cwt
- tba-protocol-oauth
- tba-protocol-oidc
- tba-protocol-security-cose
- tba-protocol-security-jose
- tba-protocol-security-jwe
- tba-protocol-security-jws
- tba-protocol-webauthn
Other direct consumers include tba-app-backend-core, tba-auth, tba-bases-identity-model, tba-capability-access-governance, tba-capability-policy-administration, tba-capability-policy-assurance, tba-concrete-authorization-provenance, tba-concrete-capability.
Non-goals
tba-primitives-identity does not take ownership of protocol flows, provider selection, or application hosting.
Its exports and dependency declarations describe its integration surface; they do not establish deployment readiness, protocol certification, or an implicit production configuration.
Related Packages
- tba-primitives-identity
- tba-contracts-identity
- tba-concrete-identity-principals
- tba-credentials
- tba-provider-identity-jose
- tba-runtime-authorization-policy
Project Links
- Package source
- Package manifest
- LICENSE and NOTICE
- Report an issue
- Package index
- Canonical SSOT registry
- PyPI project
Governance
This package is part of the SSOT-governed TBA identity package suite. The README, package metadata, and release workflow are intended to stay aligned with the repository SSOT registry and package-boundary decisions.
tba-primitives-identity follows the canonical SSOT registry and package index. Keep its 00-primitives ownership, public imports, declared dependencies, examples, and release metadata aligned.
Changes must pass the README standards gate, package checks, and the evidence requirements relevant to the changed behavior. Update SSOT through the repository's CLI workflow when changing governed claims or boundaries.
Verification
See the related repository tests for the implementation scope covered by this example.
Workspace and package catalog · tba-contracts-identity-document · Report an issue · Repository license
Metadata
Release files for tba-primitives-identity 0.4.0.dev4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tba_primitives_identity-0.4.0.dev4.tar.gz | 25.6 kB | Without provenance | Details for tba_primitives_identity-0.4.0.dev4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tba_primitives_identity-0.4.0.dev4-py3-none-any.whl | Python 3 | none | any | Details for tba_primitives_identity-0.4.0.dev4-py3-none-any.whl |
Total release size: 58.4 kB
Release files / tba_primitives_identity-0.4.0.dev4.tar.gz
| Download URL | tba_primitives_identity-0.4.0.dev4.tar.gz |
|---|---|
| Size | 25.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e57b948270d124c8ecbd6d93a2d0d81ee047eff81cd05a1085f687bb96015995
|
|
BLAKE2b-256 checksum How to use checksums |
a03808237b3bd97c489344672af6d7ce651abd43659cd5868907b22274552e57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / tba_primitives_identity-0.4.0.dev4-py3-none-any.whl
| Download URL | tba_primitives_identity-0.4.0.dev4-py3-none-any.whl |
|---|---|
| Size | 32.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
027afb54aba1ec2e695216d69811d79c4395c00d24c301b91a6e86175a65a251
|
|
BLAKE2b-256 checksum How to use checksums |
23933c0ada8b09a7b84b2f76526f4d2ddb46d94bdb9d48578ee56f8c9b596950
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for tba-primitives-identity 0.4.0.dev4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.