Skip to content

import-ldif: names are unique only in their container (#133) - #135

Merged
jcombs-pointblue merged 1 commit into
masterfrom
ldif-rdn-not-unique
Nov 16, 2026
Merged

jcombs-pointblue merged 1 commit into
masterfrom
ldif-rdn-not-unique

Conversation

@jcombs-pointblue

Copy link
Copy Markdown
Contributor

Fixes #133.

import-ldif placed objects by the RDNs between them and the driver set, and assumed everything in the LDIF belonged to the one driver set. Given an LDIF of more than the driver-set subtree (several driver sets, a Library outside them such as cn=Library,o=services), it:

  • put every Library object it found into library/, so two of one name stopped the import with duplicate artifact path: library/<name>;
  • took the drivers of every driver set (two AD drivers, say), and attached other sets' entitlements and jobs to a driver of the same name.

Now:

  • One driver set, by DN. The tree takes the chosen set's own drivers, policies, entitlements and jobs, compared as DNs (case and spaces after commas ignored). An LDIF with several driver sets needs --driver-set DN; without it the import stops and lists them.
  • Other Libraries, as import-project treats them (Model a driver set that uses Libraries in more than one container #111). Every object of a Library outside every driver set, and what the set links from another set's Library, go into library/ as read-only references with library.dn. Another set's unlinked Library objects stay out. Links to them resolve to library/.
  • Two of one name keep the driver set's own copy, with a NOTE: line (DuplicateArtifacts.drop, as import-project already does).

Checked: a two-driver-set LDIF built from the synthetic fixture plus a shared cn=Library,o=services fails on master with klasen's error. On this branch it imports with --driver-set, and check and validate are clean (one library-other info). The plain one-set fixture imports byte for byte as on master. 1064 tests pass.

import-live reads only the driver-set subtree, so it can't meet the outside Library. It gets the same duplicate handling for two objects of one name inside the subtree.

🤖 Generated with Claude Code

An LDIF of a whole vault (several driver sets, a Library outside them) stopped
with 'duplicate artifact path: library/...' and took every driver set's drivers.
The reader now takes the chosen driver set's own drivers, policies, entitlements
and jobs by DN; from other Libraries, every object of a Library outside every
driver set and what the set links from another set's Library, as read-only
references (library.dn); two of one name keep the set's own, with a NOTE.
--driver-set DN names the driver set when the LDIF holds several.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jcombs-pointblue
jcombs-pointblue merged commit 5871db7 into master Nov 16, 2026
4 checks passed
@jcombs-pointblue
jcombs-pointblue deleted the ldif-rdn-not-unique branch November 16, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't assume RDNs are globally unique

1 participant