Feature: add LDAP module#127
Open
Namoshek wants to merge 7 commits into
Open
Conversation
Greptile SummaryThis PR introduces a comprehensive LDAP module that enables workflow automation for directory services like Active Directory. The implementation includes six workflow activities ( Key Changes:
Implementation Quality:
Minor Issue:
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/modules/ldap/Elsa.Ldap/Activities/CompareLdapEntry.cs | Implements LDAP compare operation, but uses Activity<bool> instead of CodeActivity<bool> unlike other activities |
| src/modules/ldap/Elsa.Ldap/Services/LdapConnectionFactory.cs | Creates LDAP connections with proper authentication and SSL support |
| src/modules/ldap/Elsa.Ldap/Extensions/LdapConnectionExtensions.cs | Implements async LDAP operations with proper cancellation handling using APM pattern |
| src/modules/ldap/Elsa.Ldap/Activities/AddLdapEntry.cs | Adds LDAP entries with Success/Failure outcomes and proper error logging |
| src/modules/ldap/Elsa.Ldap/Activities/SearchLdapEntry.cs | Searches for single LDAP entry with Found/Not Found outcomes |
| src/workbench/Elsa.Server.Web/Program.cs | Configures LDAP module for workbench, reads connection config from appsettings |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class ILdapConnectionFactory {
<<interface>>
+CreateConnection(connectionName) ILdapConnection
}
class LdapConnectionFactory {
-LdapOptions _options
+CreateConnection(connectionName) ILdapConnection
-ResolveConnection(connectionName) LdapConnectionOptions
}
class ILdapConnection {
<<interface>>
+SendRequestAsync(AddRequest) Task~AddResponse~
+SendRequestAsync(DeleteRequest) Task~DeleteResponse~
+SendRequestAsync(ModifyRequest) Task~ModifyResponse~
+SendRequestAsync(SearchRequest) Task~SearchResponse~
+Dispose()
}
class LdapConnectionProxy {
-LdapConnection _connection
+SendRequestAsync(request) Task~Response~
+Dispose()
}
class AddLdapEntry {
+ConnectionName Input~string~
+EntryDn Input~string~
+Attributes Input~DirectoryAttribute~
+ExecuteAsync() ValueTask
}
class DeleteLdapEntry {
+ConnectionName Input~string~
+EntryDn Input~string~
+ExecuteAsync() ValueTask
}
class ModifyLdapEntry {
+ConnectionName Input~string~
+EntryDn Input~string~
+Modifications Input~DirectoryAttributeModification~
+ExecuteAsync() ValueTask
}
class SearchLdapEntries {
+ConnectionName Input~string~
+BaseDn Input~string~
+Filter Input~string~
+ExecuteAsync() ValueTask
}
class LdapFeature {
+ConfigureOptions Action~LdapOptions~
+Configure()
+Apply()
}
ILdapConnectionFactory <|.. LdapConnectionFactory
ILdapConnection <|.. LdapConnectionProxy
LdapConnectionFactory --> ILdapConnection : creates
LdapConnectionFactory --> LdapConnectionProxy : instantiates
AddLdapEntry --> ILdapConnectionFactory : uses
DeleteLdapEntry --> ILdapConnectionFactory : uses
ModifyLdapEntry --> ILdapConnectionFactory : uses
SearchLdapEntries --> ILdapConnectionFactory : uses
LdapFeature --> ILdapConnectionFactory : registers
LdapConnectionProxy --> LdapConnection : wraps
Last reviewed commit: dfb2641
Author
|
@dotnet-policy-service agree |
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.
This pull request introduces a new LDAP module to the solution, providing a suite of workflow activities for interacting with LDAP directories. It includes new activities for adding, modifying, deleting, moving, comparing, and searching LDAP entries, along with the necessary updates to the solution and package references.
LDAP Module Introduction:
Elsa.Ldap, including the main project and corresponding unit tests, and updated the solution file (Elsa.Extensions.sln) to include these projects and organize them under new solution folders. [1] [2] [3]LDAP Workflow Activities:
AddLdapEntry,DeleteLdapEntry,ModifyLdapEntry,MoveLdapEntry,CompareLdapEntry, andSearchLdapEntriesactivities in theElsa.Ldapmodule, enabling workflows to perform core LDAP operations such as adding, deleting, modifying, moving, comparing, and searching directory entries. [1] [2] [3] [4] [5] [6]Package Reference Updates:
System.DirectoryServices.Protocolsas a package dependency for both .NET 9.0 and .NET 10.0 target frameworks inDirectory.Packages.propsto support LDAP protocol operations. [1] [2]Tests:
Elsa.Ldap.UnitTests. Some tests are a bit hacky because theSystem.DirectoryServices.Protocolsclasses are very well protected from outside usage (internal constructors, etc.).