Skip to main content

Stigmem reference node — single-host production implementation

Project description

Stigmem Reference Node

Single-host reference implementation of the Stigmem protocol. The modular protocol specs live under ../spec/specs/, with the generated protocol composition at ../spec/PROTOCOL.md.

Quick start

# install
pip install .

# run (auth disabled, local db)
stigmem-node

# run with auth
STIGMEM_AUTH_REQUIRED=true STIGMEM_DB_PATH=./data/stigmem.db stigmem-node

Default port: 8765. Override with STIGMEM_PORT.

Configuration

All settings via environment variables (prefix STIGMEM_):

Variable Default Description
STIGMEM_DB_PATH stigmem.db SQLite file path
STIGMEM_HOST 0.0.0.0 Bind host
STIGMEM_PORT 8765 Bind port
STIGMEM_NODE_URL http://localhost:8765 Canonical URL for /.well-known/stigmem
STIGMEM_AUTH_REQUIRED false Enforce API-key auth
STIGMEM_LOG_LEVEL info uvicorn log level

CORS

The Stigmem node ships with CORS disabled by default. Enable it only for the deployment shape you operate.

Local development (any localhost port)

STIGMEM_CORS_DEV_LOCALHOST=1

Accepts any Origin matching ^https?://(localhost|127\.0\.0\.1)(:\d+)?$. Use this when the UI and API run on separate, dynamically chosen localhost ports.

Production with a known UI origin

STIGMEM_CORS_ALLOWED_ORIGINS=https://stigmem-ui.example.com

Production with multiple UI origins

STIGMEM_CORS_ALLOWED_ORIGINS=https://a.example.com,https://b.example.com

Self-managed regex (advanced)

STIGMEM_CORS_ALLOWED_ORIGIN_REGEX=^https://[a-z0-9-]+\.example\.com$

Credentials

STIGMEM_CORS_ALLOW_CREDENTIALS defaults to true and controls whether browsers may send cookies or Authorization headers cross-origin. Set it to false only when the deployment does not use credentialed browser requests.

Security note

Do not combine STIGMEM_CORS_DEV_LOCALHOST=1 with a production deployment. The dev-localhost regex is intentionally permissive and must only run on maintainer-controlled machines.

API

Route Description
POST /v1/facts Assert a fact (Spec-03-HTTP-API)
GET /v1/facts Query facts (Spec-03-HTTP-API)
GET /.well-known/stigmem Node metadata (Spec-03-HTTP-API)
GET /healthz Health check
GET /docs OpenAPI UI

Running tests

cd stigmem/node
pip install ".[dev]"
pytest

Docker

docker build -t stigmem-node .
docker run -p 8765:8765 -v $(pwd)/data:/data stigmem-node

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

stigmem_node-0.9.0a3.tar.gz (519.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stigmem_node-0.9.0a3-py3-none-any.whl (357.6 kB view details)

Uploaded Python 3

File details

Details for the file stigmem_node-0.9.0a3.tar.gz.

File metadata

  • Download URL: stigmem_node-0.9.0a3.tar.gz
  • Upload date:
  • Size: 519.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for stigmem_node-0.9.0a3.tar.gz
Algorithm Hash digest
SHA256 bb7c44aa1a37be3f937bbbf3465a339285c982ba8b37ae619b23098615d85326
MD5 e08ffc1830a5d38926a8e71f4f47bdb9
BLAKE2b-256 bdaf40e4f68eb87fb853b391226fd6e5a4045424e8b9810463acb4ed235f5208

See more details on using hashes here.

Provenance

The following attestation bundles were made for stigmem_node-0.9.0a3.tar.gz:

Publisher: publish.yml on eidetic-labs/stigmem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stigmem_node-0.9.0a3-py3-none-any.whl.

File metadata

  • Download URL: stigmem_node-0.9.0a3-py3-none-any.whl
  • Upload date:
  • Size: 357.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for stigmem_node-0.9.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 832db33cb6d4351b3180d3c7e598a87e22c23968b3e2b3dece70a09f4a03f7a0
MD5 b23e3f009647a5134f80293b5657c63a
BLAKE2b-256 151af10a6602e462fb383c0502cacc6bd43c11a0bf8a4f4b0cf9b52a7d33c214

See more details on using hashes here.

Provenance

The following attestation bundles were made for stigmem_node-0.9.0a3-py3-none-any.whl:

Publisher: publish.yml on eidetic-labs/stigmem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page