fix: use correct property for LDAP modify operation type#5572
fix: use correct property for LDAP modify operation type#5572ashwin-infisical merged 1 commit intomainfrom
Conversation
The ldif npm parser stores the modify operation (add/delete/replace) in change.type, not change.operation. Since change.operation was always undefined, it fell back to 'replace' for all modify operations. This caused 'add: member' to become 'replace: member' (overwriting all existing group members) and 'delete: member' to become 'replace: member' instead of removing members. This fix correctly reads change.type from the parsed LDIF. Co-Authored-By: ashwin <ashwin@infisical.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Greptile SummaryThis PR fixes a property name bug in the LDAP dynamic secret provider where Key changes:
Confidence Score: 5/5
Last reviewed commit: 1295f6b |
Context
The
ldifnpm parser stores the modify operation (add/delete/replace) inchange.type, but the code was readingchange.operation— which is alwaysundefined. This caused the fallback to"replace"for all modify operations.Impact:
add: memberin LDIF was silently sent asreplace, overwriting all existing group members instead of adding onedelete: memberin LDIF was silently sent asreplace, overwriting all group members instead of removing onereplace: userPasswordhappened to work correctly by accident (the fallback matched the intended operation)This bug affects any LDAP dynamic secret using
changetype: modifywithadd:ordelete:operations — including the Active Directory group membership example in Infisical's own LDAP docs. It is also a blocker for IBM DB2 dynamic secrets via LDAP, which require adding/removing users from LDAP groups.No existing working configurations are broken by this fix. Users relying on
replace:operations (e.g., static credential rotation) are unaffected since the fallback already matched.Steps to verify the change
ldifnpm package useschange.type(notchange.operation) for modify operations:changetype: modify+add: member(e.g., the AD example from docs)Type
Checklist
Human review notes
TEntrytype and the property access fromchange.operationtochange.typeldifnpm package (the version used in this repo) indeed usestypeand notoperationon parsed change objectsreplace:workflows — the fallback|| "replace"still applies ifchange.typewere everundefinedLink to Devin session: https://app.devin.ai/sessions/54d3af210fc54c1a957018979fa8abc5
Requested by: ashwin (ashwin@infisical.com)