Skip to main content

dinkster-token-verifier

dinkster-token-verifier verifies Dinkster access tokens and signed policy snapshots without calling the identity service for each request. It contains verification and policy code only. It does not sign or mint tokens, store accounts, access a database, or run a service.

Install

Consumers pin dinkster-token-verifier==0.1.2 in package metadata and record the resolved PyPI wheel hashes in their lockfile. Before its first PyPI publication, build a local wheel with python -m build.

Releases

Update project.version before changing a published distribution. From a validated, landed commit, an authorized maintainer pushes the matching vX.Y.Z tag. .github/workflows/release.yml builds the wheel and sdist, checks their metadata, and publishes those same artifacts to PyPI using trusted publishing. Branches and pull requests build without publishing. Consumers update their exact requirement and lock together after publication.

The repository owner must register the PyPI project dinkster-token-verifier with a trusted publisher for owner Kosinkadink, repository dinkster-token-verifier, workflow release.yml, environment pypi. Before publishing, protect that GitHub environment with required owner approval and restrict deployment to version tags. Publication requires the owner's authorization; no stored PyPI API token is used.

Access token contract

TokenVerifier accepts a compact JWS with three base64url segments and an Ed25519 protected header. typ may be omitted; when present it must be JWT:

{"alg":"Ed25519","kid":"<key id>","typ":"JWT"}

The signed payload must contain these claims:

  • iss and aud: exactly the configured issuer and audience.
  • sub: u_<uuid> for a human or k_<uuid> for an API-key agent.
  • kind: human or agent, consistent with sub.
  • org: a canonical organization UUID or null.
  • acct: the canonical account UUID.
  • key: the canonical API key UUID for an agent, otherwise null.
  • key_scopes: a nonempty, unique subset of the supported API key scopes for an agent, otherwise null.
  • grants: a map from org:<uuid> or project:<uuid> to capability strings.
  • iat and exp: integer Unix timestamps no more than 10 minutes apart.
  • jti: a canonical UUID.

The verifier allows 30 seconds of clock skew and returns None for an invalid, expired, malformed, unsupported, or unverifiable token. It returns an immutable VerifiedPrincipal after all signature, claim, scope, and context checks pass.

from dinkster_token_verifier import TokenVerifier

verifier = TokenVerifier(
    jwks_url="https://identity.example/.well-known/jwks.json",
    issuer="https://identity.example",
    audience="dinkster-session",
)
principal = await verifier.verify(access_token)

JWKS discovery and rotation contract

The caller supplies the HTTPS JWKS URL advertised by its trusted identity service. Dinkster identity publishes it at /.well-known/jwks.json. The response must be a JSON object whose keys array contains one or more public OKP Ed25519 signing keys. Every key must have a unique nonempty kid, kty: "OKP", crv: "Ed25519", alg: "Ed25519", optional use: "sig", and no private d value.

Keys are cached for at most 300 seconds by default. A smaller HTTP Cache-Control: max-age=<seconds> shortens that lifetime. An unknown kid causes one refresh so newly rotated keys become usable before the cache expires; repeated unknown key IDs are throttled for 5 seconds. A failed refresh retains a previously cached matching key and backs off another fetch for 5 seconds. Identity services must therefore publish retired public keys until every access token signed by them has expired.

Signed policy snapshots

dinkster_token_verifier.policy_snapshots verifies Ed25519 JWT policy snapshots against caller-supplied trusted JWKS. Snapshots use type dinkster-policy+jwt, format 1, an exact 10-minute lifetime, and signed inputs whose recomposition must equal the signed effective policy. The pure policy models and narrowing-only evaluator live in dinkster_token_verifier.policy.

Metadata

Release files for dinkster-token-verifier 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dinkster-token-verifier 0.1.2
File Size Uploaded Provenance Actions
dinkster_token_verifier-0.1.2.tar.gz 19.4 kB With provenance Details for dinkster_token_verifier-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dinkster-token-verifier 0.1.2
File Interpreter ABI Platform Actions
dinkster_token_verifier-0.1.2-py3-none-any.whl Python 3 none any Details for dinkster_token_verifier-0.1.2-py3-none-any.whl

Total release size: 34.6 kB

Release files / dinkster_token_verifier-0.1.2.tar.gz

Download URL dinkster_token_verifier-0.1.2.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ad4ef7da16bf78779f594d1bd19a7eb5c9a788ba5935add22bf65c140aaafca2
BLAKE2b-256 checksum
How to use checksums
981498d30856305530f8ec87d7c78da5779e16d6b17f63aacb6b4b66f6713960
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / dinkster_token_verifier-0.1.2-py3-none-any.whl

Download URL dinkster_token_verifier-0.1.2-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e162dabef69042e399180d0c5bf68f1f6ae427dd5034d1c256811d0d324a2f68
BLAKE2b-256 checksum
How to use checksums
d324094418c393b703532518f724eae15d5521c84ab874eb9c7b9d979ad96429
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for dinkster-token-verifier 0.1.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dinkster_token_verifier-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page