Skip to main content

credentials API

SDK 1.0.1. This reference describes the supported authoring interface.

CredentialUnavailable​

A declared credential cannot be resolved; messages contain no secret or path.

CredentialSelection​

Protected backend selection shared with the owner, never ordinary settings.

This model is a base for the private owner's management interface. Capability authors use CredentialReader, which cannot create, rotate or retire entries.

Fields​

root: str
backend: BackendName
namespace: str
FieldDescriptionDeclared defaults and constraints
rootAbsolute protected vault directory.min_length=1; max_length=4096
backendExplicit backend; no discovery or fallback.default="file"
namespaceOwner-provisioned native namespace.pattern="^[a-f0-9]{32}$"

CredentialAccess​

Internal admission projection shared by the native application runtime.

This contains no credential values and grants no filesystem authority. It must come from an already-admitted startup; it is not a startup validator. Authors obtain a reader from ApplicationStartup.credentials instead.

Fields​

configuration: str | None
declarations: tuple[tuple[str, bool], ...]
FieldDescriptionDeclared defaults and constraints
configuration——
declarations——

CredentialReader​

Resolve only this child's declared references without importing the host.

Call read off the event loop: journal lock waits have a two-second timeout and native resolution uses a bounded, reaped helper. Each read observes the active alias again, including rotation and retirement. Values are SecretBytes; errors reveal no values, fingerprints, backend paths or native diagnostics. Missing selected storage never creates a new store or falls back to another.

CredentialReader.__init__​

Retain only trusted startup selection and signed credential declarations.

def __init__(self, startup: Startup | CredentialAccess) -> None:
...

CredentialReader.read​

Read an active value; None means a valid optional input is unconfigured.

An undeclared reference raises ValueError. Required absence, damaged metadata, missing selected storage and unavailable native backends raise CredentialUnavailable. The method never changes aliases or versions.

def read(self, reference: str) -> SecretBytes | None:
...

read_contained_credential​

Read a declared value in the SDK-owned, parent-bounded bridge process.

This synchronous entry point starts no helper descendants. Its parent must enforce a deadline and await this process's actual exit. Normal Python applications keep using CredentialReader.read, whose native subprocess containment remains unchanged. No backend or storage fallback is permitted.

def read_contained_credential(access: CredentialAccess, reference: str) -> SecretBytes | None:
...

run_credential_helper​

Handle the SDK-only native reader command before a frozen child's normal CLI.

A child entry point calls this first and returns when it is True. Native values use private pipes, never argv. Normal child invocations return False. Pure-Python installations launch the same helper as an isolated module.

def run_credential_helper() -> bool:
...