feat(ldap): add STARTTLS support, error code mapping, and integration tests#137
Merged
jonwiggins merged 2 commits intomainfrom Mar 28, 2026
Merged
Conversation
… tests Add STARTTLS (RFC 4511 Extended Operation) support to upgrade plain ldap:// connections to TLS, with both required (--ssl-reqd) and opportunistic (--ssl) modes following the same pattern as SMTP/IMAP/POP3. Add proper CURLE_LDAP_CANNOT_BIND (38) error code for bind failures instead of reusing CURLE_LDAP_SEARCH_FAILED (39), and use dedicated LdapBind/LdapSearch error variants for correct FFI mapping. Add 26 integration tests with a mock BER-speaking LDAP server covering: anonymous/authenticated bind, multiple entries, multi-valued attributes, binary base64 encoding, all three scopes, filter types (equality, presence, substring, AND/OR/NOT), LDAPS implicit TLS, STARTTLS required/try/fallback modes, error paths, and output format verification. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CI uses RUSTFLAGS="-D warnings" which promotes warnings to errors. Add allows for doc_markdown, redundant_closure_for_method_calls, used_underscore_binding, and unused_results in test code. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ldap://connections to TLS, following the sameUseSslpattern as SMTP/IMAP/POP3. Supports both--ssl-reqd(required, fail if unavailable) and--ssl(opportunistic, fall back to plain) modes.CURLE_LDAP_CANNOT_BIND(38) for bind failures andLdapBinderror variant, instead of reusingCURLE_LDAP_SEARCH_FAILED(39). Use dedicatedLdapSearcherror for search failures.Test plan
cargo clippypasses with zero errorscargo fmt --checkpasses🤖 Generated with Claude Code