-
Notifications
You must be signed in to change notification settings - Fork 13k
feat: ldap custom variables / string manipulation #35717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: ffa345d The changes in this PR will be included in the next version bump. This PR includes changesets to release 37 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #35717 +/- ##
===========================================
+ Coverage 60.98% 61.16% +0.18%
===========================================
Files 2955 2971 +16
Lines 70526 70839 +313
Branches 16169 16185 +16
===========================================
+ Hits 43008 43330 +322
+ Misses 24570 24560 -10
- Partials 2948 2949 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
This PR currently has a merge conflict. Please resolve this and then re-add the |
Co-authored-by: Marcos Spessatto Defendi <[email protected]>
Co-authored-by: Marcos Spessatto Defendi <[email protected]>
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
1 similar comment
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
1 similar comment
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Proposed changes (including videos or screenshots)
This PR adds new settings to configure custom variables that can be created based on data from LDAP attributes, manipulating the data received from LDAP with certain helpers functions, such as string replace, split and match.
For example, with this PR it is possible to receive an attribute from LDAP containing an email address, split that string value by the
@symbol and then use the left side of it as the value for theusernamefield on rocket.chat.It was done mostly to solve a specific need we were facing, so the only operations supported are the ones we found could be useful at this moment. It can be expanded to support other operations in the future if the need arises.
The operations it currently supports are:
Issue(s)
CORE-1070
Steps to test or reproduce
Further comments
This pull request introduces new functionality for handling LDAP custom variables and string manipulation within the Rocket.Chat application. The key changes include:
LDAP Variable Processing:
processLdapVariablesis added to dynamically process and map LDAP entry attributes based on a configuration map.LDAP_DataSync_UseVariablesandLDAP_DataSync_VariableMapare introduced to enable and define variable mappings for LDAP data synchronization.Refactoring and Utility Functions:
LDAPManagerclass is refactored to improve modularity by extracting several private static helper methods into separate utility functions (getLdapDynamicValue,getLdapString,ldapKeyExists).executeOperation,executeFallback,executeMatch,executeReplace,executeSplit, andexecuteSubstring, to handle different string manipulations and transformations.Configuration and Localization:
These enhancements aim to provide more flexible and configurable LDAP data processing capabilities, improving the overall functionality and maintainability of the LDAP integration within Rocket.Chat.
This pull request introduces new functionality for handling custom variables and string manipulation within the LDAP data mapper in the Rocket.Chat application. The changes include:
New LDAP Settings: Two new settings,
LDAP_DataSync_UseVariablesandLDAP_DataSync_VariableMap, have been added to enable and configure variable mappings for LDAP data synchronization.Utility Functions: Several new utility functions have been introduced to support LDAP operations:
getLdapDynamicValue: Retrieves values from an LDAP entry based on a configuration string.getLdapString: Extracts string values from LDAP entries.ldapKeyExists: Checks for the existence of LDAP keys.executeOperation: Centralizes the execution of various string manipulation operations.executeFallback,executeMatch,executeReplace,executeSplit,executeSubstring: Handle specific string operations like fallback values, matching, replacing, splitting, and substring extraction.Refactoring: The
LDAPManagerclass has been refactored to improve modularity by moving helper methods into separate utility functions.Process LDAP Variables: A new function,
processLdapVariables, has been added to dynamically process and map LDAP entry attributes based on a configuration map.Localization: Two new translation keys for the LDAP Data Sync variables have been added to the English localization file.
Changeset: A changeset file has been added to describe minor version bumps for related packages and summarize the introduction of new settings for configuring custom variables with string manipulation functions.
These enhancements aim to provide more flexible and powerful LDAP data synchronization capabilities by allowing custom variable configurations and string manipulations.