FreeIPA-API writes (user/group mutations) #3
Reference in New Issue
Block a user
Delete Branch "feat/freeipa-api-writes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Raw LDAP adds/modifies bypassed FreeIPA's framework: group/user creates failed with
Object Class Violation(no DNA-assignedgidNumber/uidNumber/ipaUniqueID, missing object classes) and deletes/mods couldn't be done as plain LDAP writes by the service bind account.What
Route all mutations through the FreeIPA JSON-RPC API; reads stay on direct LDAP.
internal/client/freeipa.go(new): JSON-RPC client — formlogin_password→ipa_sessioncookie, re-auth on 401, multi-server failover, TLS via the configured CA. Derives the API host + login uid from the LDAP config.internal/service/ldap.go:group_add/_mod/_del/_add_member/_remove_member;user_add/_mod/_disable/_enable/passwd. Services map →addattr(objectclass)/setattr. Writes error cleanly if the IPA client is unconfigured.cmd/server/main.go: build + inject the FreeIPA client.Ops prerequisites (done)
The bind account
svc-ops-apiwas given a non-expiring service password policy (svc-accounts, maxlife=0) and rotated; bind creds now stored in Infisical so ops-api binds authenticated (reads) and authenticates the IPA API (writes). It holds theUser Administratorrole (incl. Group Administrators privilege).Verified live (binary 1.2.0)
group create (IPA-assigned
gidNumber), get, add/remove member, delete → all 200/201; reads unchanged. gscAdmin-continuum's group/user write actions (already on ops-api) now function.🤖 Generated with Claude Code