Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -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).

Expand Down
8 changes: 8 additions & 0 deletions api_keys.sql → dd.sql
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Loading