Use this file to discover all available pages before exploring further.
Authsome is layered. Each layer has one bounded responsibility. Layers do not reach sideways into other layers. Explicit orchestrators compose them. This makes every layer independently testable and independently swappable.The supported integration mode is the sidecar: authsome run -- python agent.py spawns the agent as a subprocess of authsome with an HTTP proxy injecting credentials at request time. No auth code in the agent.The same layered architecture is also exposed as a Python library (from authsome.server.dependencies import create_auth_service) for embedding inside a larger orchestrator. The two modes share the same layers below.Sidecar-mode call graph. Identity and policy gate the vault; the auth layer refreshes when needed; the sidecar writes back, injects the Authorization header, and audits at every step.
agent ↓ HTTP request via HTTP_PROXY=localhost:<port>[ sidecar ] proxy-mode orchestrator ↓identity → signed principal chain (actor=agent, subject=user) ↓policy → allow / deny ↓vault → encrypted credential record ↓ if expired:auth (low) → external token endpoint → fresh credential ↓sidecar → vault.write(fresh credential) ↓sidecar injects Authorization header ↓external API ↓audit ← append-only log entry at every step
Vault does not know about OAuth, providers, token expiry, refresh, policy, audit, or principal-chain semantics. It stores and retrieves credential records by key. Orchestrators decide which keys to read, whether access is allowed, whether a token must be refreshed, and what should be audited.The local backend uses an encrypted KV store under ~/.authsome/server/kv_store/. Field-level encryption uses AES-256-GCM with a 256-bit data key and a 96-bit nonce per encryption. The data key is wrapped by either a local file (~/.authsome/server/master.key, mode 0600) or the OS keyring.See Credential storage for the storage model and key namespace.
The Auth layer has two intentionally separate surfaces.Low level (auth.flows). A pure function. Receives expired credentials and refresh material. Calls the external token endpoint. Returns fresh credentials and updated expiry. No vault access. No side effects. Independently testable.High level (AuthLayer). A stateful orchestrator with a vault dependency. Reads the credential from the vault, calls the stateless refresh if expired, writes the result back, returns a usable token. This is what library users call.
from authsome.server.dependencies import create_auth_serviceauth = create_auth_service()token = auth.get_access_token("github", connection="default")
Acquisition flows shipped today: , , + PKCE, and an API-key flow.
AuthService owns OAuth flows, token refresh, and the login/logout/revoke lifecycle. It receives a Vault, a ProviderRegistry, and an AppStore as dependencies. The daemon assembles one per profile; library callers build one with create_auth_service().
from authsome.server.dependencies import create_auth_serviceauth = create_auth_service()token = auth.get_access_token("github", connection="default")
AuthLayer is a thinner facade exposing the building blocks (vault(), registry(), identity(), app_store()) for callers that need them directly. See Python library.