Canonical Veltro suite auth contract: Auth.js session decode + suite-service token mint/verify.
Project description
veltro-suite-auth
The canonical Veltro suite auth contract — one published Python package for the two cross-service security primitives shared across the Veltro suite (VectorFlow, CHAD, WARDEN). Before this package each app carried its own byte-identical copy of the decoder/verifier; CHAD and WARDEN now depend on this package and carry none.
What it provides
veltro_suite_auth.session— decode VectorFlow's Auth.js v5 session cookie (JWE,alg=dir/enc=A256CBC-HS512, HKDF-SHA256 key salted by the cookie name) for delegated suite login.decode_session(cookies, secret) -> SessionClaims | NoneSessionClaims,SessionError/SessionInvalid/SessionExpiredSESSION_COOKIE_NAMES,derive_encryption_key
veltro_suite_auth.service_token— mint + verify the short-lived (60s), scoped, HS256 suite-service token used for machine-to-machine calls between suite apps (issuerveltro-suite, audiencesuite-service).mint_service_token(secret, *, scope, svc, actor_email=None, actor_suite_role=None) -> strverify_service_token(token, secret, required_scope) -> ServiceTokenClaimsServiceTokenClaims,ServiceTokenError/ServiceTokenInvalid/ServiceTokenExpiredSUITE_SERVICE_ISSUER,SUITE_SERVICE_AUDIENCE,SUITE_SERVICE_MINTERS,SUITE_SERVICE_TOKEN_TTL_SECONDS
veltro_suite_auth.testing— golden cross-language vectors, shipped in the wheel:session_fixture(),service_token_vectors().
Old settings:* and external:* families keep optional actor claims.
Product-scoped chad:* and warden:* tokens require both actor_email and
actor_suite_role, and verification rejects them otherwise.
Contract source & rename map
The code was moved verbatim from CHAD's backend/app/core/vf_session.py
and backend/app/core/suite_service_token.py, plus WARDEN's minting logic from
backend/app/services/suite_token.py. Only symbol names and CHAD/WARDEN-specific
docstring prose changed:
| old (CHAD / WARDEN) | new (veltro_suite_auth) |
|---|---|
decode_vf_session |
decode_session |
VfSessionClaims |
SessionClaims |
VfSessionError / VfSessionInvalid / VfSessionExpired |
SessionError / SessionInvalid / SessionExpired |
SESSION_COOKIE_NAMES, derive_encryption_key |
unchanged |
verify_suite_service_token |
verify_service_token |
SuiteServiceClaims |
ServiceTokenClaims |
SuiteServiceTokenError / ...Invalid / ...Expired |
ServiceTokenError / ServiceTokenInvalid / ServiceTokenExpired |
SUITE_SERVICE_ISSUER / SUITE_SERVICE_AUDIENCE / SUITE_SERVICE_MINTERS |
unchanged |
WARDEN mint_suite_service_token(scope) (settings-coupled) |
mint_service_token(secret, *, scope, svc, ...) (explicit params) |
Cross-language conformance
The suite has a TypeScript minter (VectorFlow's
src/server/services/suite/service-token.ts) and this Python decoder/verifier.
Two per-PR gates in the VectorFlow repo keep them from drifting:
suite-auth-contractCI job — installs this package and runs its tests, includingtests/conformance/test_fresh_session_roundtrip.py, which shellsnode scripts/mint-test-session.mjsto mint a fresh Auth.js cookie and decodes it here. Catches VF-minter ⟂ Python-decoder drift on the session cookie.contract-vectors.test.ts— pins the committedvectors/service-token-vectors.jsonagainst the live TS minters (mintSuiteServiceToken/mintSuiteExternalToken). Catches TS-minter drift on the service token; the Python side of the same vectors is asserted bytests/test_vectors.py.
Regenerating the vectors
-
session-fixture.json— a fixed Auth.js cookie. Regenerate with VectorFlow's script (from the repo root):node scripts/mint-test-session.mjs > packages/suite-auth-py/src/veltro_suite_auth/vectors/session-fixture.json
-
service-token-vectors.json— ten suite-service vectors covering the legacy scopes, every actor-required MCP family,svc=veltro, and rejection of an actorless MCP token. Regenerate with (from the repo root):EMIT_CONTRACT_VECTORS=1 pnpm vitest run src/server/services/suite/__tests__/contract-vectors.test.ts
Local development
# from packages/suite-auth-py/
python3.11 -m venv .venv && . .venv/bin/activate
pip install -e . pytest
pytest -v # conformance test needs `node` + a repo checkout, else it skips
Publish (after merge to main)
The Publish suite auth to PyPI workflow builds and publishes with PyPI
Trusted Publishing. Its PyPI publisher must match:
- owner:
veltrosecurity - repository:
vectorflow - workflow:
publish-suite-auth.yml - environment:
pypi
Dispatch the workflow from main. Never republish an existing version — bump
both pyproject.toml and veltro_suite_auth.__version__ for every release.
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
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 veltro_suite_auth-1.1.0.tar.gz.
File metadata
- Download URL: veltro_suite_auth-1.1.0.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8db887e5f9c4705d2a7a39f4814d938ed0735f511e5a8138f90176396baef388
|
|
| MD5 |
8c3765433a4b5322379536beb5a2a034
|
|
| BLAKE2b-256 |
02acbcdbbd1777105866d12ec105ef7b7eca62b0e2ea9ad072abc25749df70cb
|
Provenance
The following attestation bundles were made for veltro_suite_auth-1.1.0.tar.gz:
Publisher:
publish-suite-auth.yml on veltrosecurity/vectorflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veltro_suite_auth-1.1.0.tar.gz -
Subject digest:
8db887e5f9c4705d2a7a39f4814d938ed0735f511e5a8138f90176396baef388 - Sigstore transparency entry: 2222265278
- Sigstore integration time:
-
Permalink:
veltrosecurity/vectorflow@f8e8d271a296ffd3cb3d0ca53d00f416a76f5ff0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/veltrosecurity
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish-suite-auth.yml@f8e8d271a296ffd3cb3d0ca53d00f416a76f5ff0 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file veltro_suite_auth-1.1.0-py3-none-any.whl.
File metadata
- Download URL: veltro_suite_auth-1.1.0-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ab33a9eaa10863ea44f5090161ae12c595b7b2d3e40acb713e3a6dc57def05a
|
|
| MD5 |
2214ad9234e10fb922d6cc3be8d7dcb1
|
|
| BLAKE2b-256 |
043e612c46764a46dcb176ce7c386f23fdeea9a7901e162612d7c84123ac6239
|
Provenance
The following attestation bundles were made for veltro_suite_auth-1.1.0-py3-none-any.whl:
Publisher:
publish-suite-auth.yml on veltrosecurity/vectorflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veltro_suite_auth-1.1.0-py3-none-any.whl -
Subject digest:
2ab33a9eaa10863ea44f5090161ae12c595b7b2d3e40acb713e3a6dc57def05a - Sigstore transparency entry: 2222265352
- Sigstore integration time:
-
Permalink:
veltrosecurity/vectorflow@f8e8d271a296ffd3cb3d0ca53d00f416a76f5ff0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/veltrosecurity
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish-suite-auth.yml@f8e8d271a296ffd3cb3d0ca53d00f416a76f5ff0 -
Trigger Event:
workflow_dispatch
-
Statement type: