ops: align production ETL with legacy admin source

This commit is contained in:
Jesse_Chen
2026-08-09 13:53:07 +08:00
parent 664d8adbf0
commit d36ca7aac2
3 changed files with 31 additions and 6 deletions
@@ -10,6 +10,7 @@ import {
normalizeAuthUser,
normalizeAuthUsers,
parseMode,
readActiveAdminUserIds,
readConfiguration,
readSchema,
rowsSha256,
@@ -126,6 +127,20 @@ test("production identity preflight rejects duplicate canonical emails", () => {
);
});
test("legacy production without admin tables promotes only the designated Owner", async () => {
const ownerId = "018f4e6d-7a11-7000-8000-000000000001";
const source = {
async query() {
throw new Error("legacy fallback must not query a missing admin_users table");
},
};
assert.deepEqual(
[...await readActiveAdminUserIds(source, new Map(), ownerId)],
[ownerId],
);
});
test("active administrators become usable identity admins", () => {
const ownerId = "018f4e6d-7a11-7000-8000-000000000001";
const adminId = "018f4e6d-7a11-7000-8000-000000000002";