Skip to main content

Project-token HTTP v1

Package nirs4all-access 0.1.0 (Python >=3.11) is an independent standard-library leaf. Import nirs4all_access; no Cluster, scheduler, science or HTTP dependency. CONTRACT_VERSION=1, STORE_SCHEMA=nirs4all-access/project-token-store/v1. Its API is specified in API.md. All services use this verifier, never copied parsers or a mandatory compute-service dependency. Optional service extra: nirs4all-access>=0.1,<0.2, imported lazily by the service adapter.

Tokens match fullmatch n4p1\.[0-9a-f]{16}\.[0-9a-f]{64}. The middle component is the key ID; the last is 256 random bits. Hash is sha256: plus lowercase SHA256 of b"nirs4all-access/project-token/v1\x00" + ascii(token); the separator is one NUL byte. Credentials are never persisted in clear text. Provisioning intentionally returns the generated secret once.

ProjectPrincipal is frozen and contains project_id, principal_id, services, rights, group_ids. Project IDs match [a-z0-9][a-z0-9_-]{0,62} excluding Windows reserved devices con/prn/aux/nul/com1-9/lpt1-9. Principal IDs match [a-z0-9][a-z0-9._-]{0,127}. Services match [a-z][a-z0-9-]{0,31}. Assigned IDs: cluster, arena, datasets, repository. Rights match <service>.<action> where action matches [a-z][a-z0-9_]{0,31}. Right prefixes must equal services. Rights are exact membership: cluster.admin alone does not grant cluster.submit. Roles are owner constants expanded to explicit rights; Cluster admin expands to read/submit/cancel/execute/admin. Content services own their action vocabularies. No implicit groups or wildcard grants: group_ids must be empty until schema v2. One credential grants exactly one immutable project; names are not authority.

Store JSON has exactly schema and credentials. Records have exactly nine required fields: key_id, token_hash, project_id, principal_id, services, rights, group_ids, expires_at, revoked. Expiry is finite numeric epoch seconds or null, never bool; revoked is bool only. Unknown fields (including plaintext token), duplicate keys, array duplicates, duplicate digests/key IDs, nonfinite numbers and malformed UTF-8 are rejected. Canonical dump sorts keys, records by key_id and arrays, compact JSON with a trailing newline. Writes use a same-directory O_EXCL temp file, enforce 0600 with fchmod where available regardless of umask, fsync, and replace. Loading checks the raw descriptor before reading and refuses non-regular files without blocking, including FIFOs, symlinks to FIFOs, directories and devices. Symlinks to private regular files are accepted. POSIX loading refuses group/other permissions; Windows permission-bit enforcement is unavailable. Stores are trusted operator configuration. Verifiers are immutable restart snapshots; each service must refuse startup with zero currently active credentials for that service.

Authenticate HTTP and WS from Authorization: Bearer <token> before body reads. Scheme is case insensitive; one or more spaces allowed; no whitespace inside the token. Refuse query credentials and all project selector headers/paths. Owner adapters sanitize rejected query strings before logging. This is necessary but insufficient: transport DEBUG logging may expose request targets and headers before ASGI runs. Owned adapters must also use a fixed quiet transport profile; for Uvicorn this is log_config=None, log_level="warning", access_log=False, with root/owned-handler allow-list filtering that keeps third-party records at WARNING or stricter. Application diagnostic verbosity must never enable wire or access logs. Direct hosts, reverse proxies, packet captures, core dumps, debuggers and shell history remain operator-owned. Query strings are not an authentication channel; even opaque embedded values must not reach owned logs. This documentation successor changes no leaf Python/API/schema/vector behavior. Client credential source is NIRS4ALL_PROJECT_TOKEN or a private --token-file, never argv.

Validation order: programmer errors (invalid service, string required_rights, cross-service rights, nonfinite now) raise ValueError. Missing/malformed/unknown/ wrong/revoked/expired credentials return identical 401, code invalid_credential, detail invalid or missing credential, with WWW-Authenticate: Bearer. Expired means now >= expires_at. Known/unknown keys use constant-time hash comparison, including a dummy hash for unknown keys. Valid credential lacking service gives 403 service_not_granted; lacking rights gives 403 missing_rights with sorted names. Only after authorization does the owner return 404 for unknown/foreign resources. No open mode. An empty verifier denies all requests.

Only localhost and IP loopback literals permit cleartext. Every other host needs TLS or an explicit trusted TLS-proxy acknowledgement. Both transport flags must be bool; strings and numeric flags raise ValueError. Worker session secrets, attempt fences and partitioned store policies remain Cluster-owned. A project consumer grants code execution on trusted project providers, not a sandbox.

Golden vectors: tests/vectors/project-token-v1.json. Run tests/check_vectors.py against an installed wheel with python -I; it blocks nonstdlib service imports.

Metadata

Release files for nirs4all-access 0.1.0

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

Source distribution (sdist)

Source distribution for nirs4all-access 0.1.0
File Size Uploaded Provenance Actions
nirs4all_access-0.1.0.tar.gz 45.4 kB With provenance Details for nirs4all_access-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nirs4all-access 0.1.0
File Interpreter ABI Platform Actions
nirs4all_access-0.1.0-py3-none-any.whl Python 3 none any Details for nirs4all_access-0.1.0-py3-none-any.whl

Total release size: 92.0 kB

Release files / nirs4all_access-0.1.0.tar.gz

Download URL nirs4all_access-0.1.0.tar.gz
Size 45.4 kB
Tags Source
SHA-256 checksum
How to use checksums
75f95bbf8960daaa949b8065afb183a5db0181573be28f2d9069ac1a13527316
BLAKE2b-256 checksum
How to use checksums
a238790838432063be40e59c6f9a8d18ef40464b16cd923357f258662affbfcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Nov 9, 2026.

Transparency log

Release files / nirs4all_access-0.1.0-py3-none-any.whl

Download URL nirs4all_access-0.1.0-py3-none-any.whl
Size 46.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e0abfb58f633139c6c17cc51b68df3013b8ac45ef2faa63b012bca9746bb7c9
BLAKE2b-256 checksum
How to use checksums
458a6ffe70f2886c67a3a5777892c6845134d2af744f603d4696f2cfec0ec5eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Nov 9, 2026.

Transparency log

Security for nirs4all-access 0.1.0

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nirs4all_access-0.1.0.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 Nov 9, 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.0 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