Skip to main content

KERIA

GitHub Actions codecov Documentation Status

KERI Agent in the cloud

Split from KERI Core

KERIA Service Architecture

Here we detail the components of a single KERIA instance. This architecture protects the host and the holder private keys. All client tasks/calls are signed 'at the edge', not in the hosted KERIA instance. Therefore, KERIA relies on the Signify protocol for all calls. The Architecture provides three endpoints for Signify clients to create their KERIA agents. The Agency (boot) endpoint establishes an agent. The API Handler and Message Router endpoints would be exposed to the internet for creating identifiers, receiving credentials, etc. KERIA

Message Router

The Message Router receives external KERI protocol messages. These are KERI protocol messages for instance coordinating multi-sig, revoking credentials, etc. It routes these messages to the appropriate Agent(s). For instance a multisig message requires asynchronous waiting (for signature responses from other participants) and the message router would route those incoming KERI protocol responses to the appropriate agents. From Signify client calls, this service endpoint corresponds to the http port (default is 3902). This endpoint allows all KERI clients (not just Signify) to interact in a seamless way.

The Agency

The Agency receives API requests (/boot requests) to provision agents. It is the central repository for initializing agents. The Agency database persists all of the information to track the existing agents, allowing recovery on restart. From Signify clients calls, this service endpoint corresponds to the boot port (default is 3903). A common entry in the agency is the mapping between a managed AID and the agency that handles that managed AID.

API Handler

The API Handler receives agent API requests (/agent requests) including for Signify clients to create identifiers, receiving credentials, etc. All API calls are signed by the Signify client headers so that all calls are secure. This API interacts with agents and those interactions are stored in the agent databases. From Signify clients calls, this service endpoint corresponds to the admin port (default is 3901).

Agents

Agents act on behalf of their Signify clients. They don't have the secrets of the client. Instead, they handle all actions for the clients, other than secret/encryption/signing. However, Agents do have their own keys and do sign all of their messages BACK to the Signify client, so the client can verify that all messages received are from their agent. Agents use KERI HIO to handle all of the different asynchronous actions that are occuring. HIO is an efficient and scalable orchestration/processing mechanism that leverages queues, handlers, coroutines, etc. All Agent db access is through the associated Agent.

Development

Setup

  • Ensure Python version 3.12.2+ is installed
  • Install uv for Python package management
  • Install Keripy dependency (libsodium 1.0.18+)

Quick Start

# Prerequisites: Python 3.12.2+, uv, libsodium
make install-dev
make test

uv run keria start --config-dir scripts --config-file demo-witness-oobis

Build with docker

  • Build KERIA docker image:
    make build-keria
    

Run with docker

  • The easiest way to configure a keria container is with environment variables. See below example for a working docker-compose configuration
services:
    keria:
        image: weboftrust/keria:latest
        environment:
            KERI_AGENT_CORS: 1
            KERIA_CURLS: http://<keria-hostname>:3902/
            KERIA_IURLS: http://<witness-demo-hostname>:5642/oobi/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha;http://<witness-demo-hostname>:5643/oobi/BLskRTInXnMxWaGqcpSyMgo0nYbalW99cGZESrz3zapM
        ports:
            - 3901:3901
            - 3902:3902
            - 3903:3903

You can see a working example here.

Running Tests

  • Run the test suites:

    make test
    
  • Run tests with coverage:

    make test-coverage
    

Publishing containers

Enable the containerd image store

The containerd image store isn't enabled by default. To enable the feature for Docker Desktop:

Navigate to Settings in Docker Desktop. In the General tab, check Use containerd for pulling and storing images. Select Apply & Restart.

make build-keria
make publish-keria

The manual Publish Docker image workflow builds the Git tag named by its version input (for example, 0.4.2). Create that tag from the reviewed release commit, whose pyproject.toml version must match. The workflow publishes the version tag and latest; PyPI publication is a separate release step.

Metadata

Release files for gleif-keria 0.4.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 gleif-keria 0.4.2
File Size Uploaded Provenance Actions
gleif_keria-0.4.2.tar.gz 109.1 kB Without provenance Details for gleif_keria-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gleif-keria 0.4.2
File Interpreter ABI Platform Actions
gleif_keria-0.4.2-py3-none-any.whl Python 3 none any Details for gleif_keria-0.4.2-py3-none-any.whl

Total release size: 230.2 kB

Release files / gleif_keria-0.4.2.tar.gz

Download URL gleif_keria-0.4.2.tar.gz
Size 109.1 kB
Tags Source
SHA-256 checksum
How to use checksums
986192d98ac29b35b5949fc08e915c146770b3ded2fee6ff3dc3a6f889e08d6f
BLAKE2b-256 checksum
How to use checksums
e6d8dea0741bdb4ea4e3f8beae5328370ed9f37f5f1f392d5c7d9aeb135902ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / gleif_keria-0.4.2-py3-none-any.whl

Download URL gleif_keria-0.4.2-py3-none-any.whl
Size 121.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f31b5dc4184f1ae39e54c4c836cc346720cd3e7b7fd0360c9b451b3e414a910
BLAKE2b-256 checksum
How to use checksums
86e308aee6e211e7427a175e14c077561467b4289ad4156b099d521c46b895d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for gleif-keria 0.4.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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