Add import-directory: set up an exported directory on inbuxa #37

Merged
jcoffey-dev merged 1 commits from feat/import-directory into main 2026-10-30 16:04:02 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev 0355fb28f7 Add import-directory: set up an exported directory on inbuxa
ci / test (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 2m51s
ci / announce (pull_request) Skipped
Reads the directory.json export-directory writes and creates, through
the registry with an administrator's credentials, the tenants, roles
(then their parent roles), domains, groups, users and mailing lists,
in that order, with aliases, quotas, roles, permissions and group
memberships. What the server already has, by name or address, is
skipped and never changed, so a second run creates nothing.

Each user created gets a generated password (24 characters from 56
letters and digits without look-alikes, by rejection sampling from
getrandom), written as email,password to a new mode-600 file after
each batch is made. Creates go in batches within maxObjectsInSet and
are sent once, never retried; refusals are counted with the server's
reason and the rest go on. A dry run reads, counts and writes nothing.

Tested with a stateful mock registry (export, import into an empty
server, export again: same directory.json; passwords match what was
stored; a second run creates nothing) and against an inbuxa 27.1-rc.4
container, where a generated password signs in.
2026-10-30 08:59:12 -07:00