feat(governance): serve members, access policies and denials (#2023)

This commit is contained in:
sam committed 2026-11-22 02:43:06 +11:00
1 parent 81dcc7d94e
commit 5004e8b40b
16 files changed
+1531 -14

No files matched your search

+1
View File
@@ -44,6 +44,7 @@ func (m apiModules) register(api huma.API) {
m.settings.Register(api)
m.settings.RegisterAccounts(api)
m.settings.RegisterOrganisations(api)
m.settings.RegisterAccess(api)
m.conns.Register(api)
m.system.Register(api)
m.tell.Register(api)
@@ -0,0 +1,15 @@
-- +goose Up
-- The members page shows when each person last signed in. Sessions expire and
-- are purged, so the time is kept on the account.
ALTER TABLE governance.accounts ADD COLUMN last_sign_in_at timestamptz;
UPDATE governance.accounts a
SET last_sign_in_at = s.last
FROM (
SELECT identity_id, max(issued_at) AS last
FROM governance.account_sessions GROUP BY identity_id
) s
WHERE s.identity_id = a.identity_id;
-- +goose Down
ALTER TABLE governance.accounts DROP COLUMN last_sign_in_at;