Files
archie/internal/platform/pg/migrations/00042_events_source_verification.sql
T

11 lines
552 B
SQL

-- +goose Up
-- How a source's deliveries are verified. A token source checks the bearer
-- token. An hmac source checks a signature over the raw body using a shared
-- secret, which is stored sealed. A source set to none performs no check.
ALTER TABLE events.sources
ADD COLUMN verification text NOT NULL DEFAULT 'token'
CHECK (verification IN ('token', 'hmac', 'none')),
ADD COLUMN hmac_header text NOT NULL DEFAULT '',
ADD COLUMN hmac_prefix text NOT NULL DEFAULT '',
ADD COLUMN hmac_secret_sealed bytea NOT NULL DEFAULT '';