Skip to content

[enhancement] Improve ldap functions#22

Merged
p0dalirius merged 5 commits intomainfrom
improve-ldap-functions
May 31, 2025
Merged

[enhancement] Improve ldap functions#22
p0dalirius merged 5 commits intomainfrom
improve-ldap-functions

Conversation

@p0dalirius
Copy link
Copy Markdown
Contributor

No description provided.

@p0dalirius p0dalirius self-assigned this May 31, 2025
@p0dalirius p0dalirius added the enhancement New feature or request label May 31, 2025
@p0dalirius p0dalirius requested a review from Copilot May 31, 2025 13:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances LDAP helper functions by improving error handling, renaming methods for clarity, and adding support for flushing attributes when no values are provided.

  • Renamed and updated the base-DN existence check to return an error alongside the boolean.
  • Extended OverwriteAttributeValues to call FlushAttributeValues when given an empty slice.
  • Renamed FlushAttribute to FlushAttributeValues for consistency.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
network/ldap/naming_contexts.go Renamed BaseDNExists to DistinguishedNameExists, updated signature and docs.
network/ldap/modify.go Added empty-slice handling in OverwriteAttributeValues; renamed flush method.
Comments suppressed due to low confidence (1)

network/ldap/modify.go:187

  • New conditional branch for empty attribute values should be covered by unit tests to verify FlushAttributeValues is invoked correctly.
if len(attrVals) == 0 {

Comment thread network/ldap/naming_contexts.go
Comment thread network/ldap/naming_contexts.go Outdated
Comment thread network/ldap/modify.go
@p0dalirius p0dalirius merged commit fa21ee8 into main May 31, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants