diff --git a/README.md b/README.md index 9d141d3..7ad228e 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,11 @@ HTTP API providing user/client message handling for an fmsg host. Exposes CRUD o Standard PostgreSQL environment variables (`PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD`, `PGDATABASE`) are used for database connectivity. +fmsg-webapi assumes [fmsgd](https://github.com/markmnl/fmsgd) is the fmsg host +implementation and uses the same PostgreSQL database. The fmsgd schema remains +the base schema; this repository's [dd.sql](dd.sql) adds the API-key and +delegation tables used by fmsg-webapi. + A `.env` file placed in the working directory is loaded automatically at startup (values in the environment take precedence). @@ -106,7 +111,7 @@ X-FMSG-Act-As: @user_bot@example.com The requested address must be granted to the authenticated user and must exist in fmsgid. -Apply [api_keys.sql](api_keys.sql) before enabling API-key auth. Existing +Apply [dd.sql](dd.sql) before enabling API-key auth. Existing deployments that already applied the earlier API-key table should apply [api_keys_delegation.sql](api_keys_delegation.sql). diff --git a/api_keys.sql b/dd.sql similarity index 85% rename from api_keys.sql rename to dd.sql index 6915de8..c9f9e2b 100644 --- a/api_keys.sql +++ b/dd.sql @@ -1,3 +1,11 @@ +-- fmsg-webapi database extensions. +-- +-- This file extends the fmsgd schema at: +-- https://github.com/markmnl/fmsgd/blob/main/dd.sql +-- +-- fmsg-webapi assumes fmsgd is the fmsg host implementation and uses the same +-- PostgreSQL database. + CREATE TABLE IF NOT EXISTS fmsg_api_sub_account ( owner_addr varchar(255) NOT NULL, agent varchar(64) NOT NULL,