metal-kompanion/db/init/011_auth.sql
Χγφτ Kompanion f2f7879f42 Add bearer authentication based on namespace
While there can be namespaces without a secret, commonly
the namespace should basically be the username and the
password the login secret.
2025-10-16 21:57:50 +02:00

8 lines
327 B
SQL

-- Auth secrets for bearer token authentication
CREATE TABLE IF NOT EXISTS auth_secrets (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
namespace_id UUID NOT NULL REFERENCES namespaces(id) ON DELETE CASCADE,
secret_hash TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
UNIQUE(namespace_id)
);