- By default GO will now bind to all interfaces for both http and https connectors. This simplifies setup for first-time users.
- Removed docs indicator on the repositories page
- Removed the repository setting to enable Markdown document enumeration, this is now automatic and expanded
+ - Retrieve LDAP groups with dereferencing aliases (pr-122)
additions:
- Added an optional MirrorExecutor which will periodically fetch ref updates from source repositories for mirrors (issue-5). Repositories must be manually cloned using native git and "--mirror".
- Added branch graph image servlet based on EGit's branch graph renderer (issue-194)
import java.net.URI;\r
import java.net.URISyntaxException;\r
import java.security.GeneralSecurityException;\r
+import java.util.Arrays;\r
import java.util.HashMap;\r
import java.util.List;\r
import java.util.Map;\r
import com.gitblit.utils.ArrayUtils;\r
import com.gitblit.utils.StringUtils;\r
import com.unboundid.ldap.sdk.Attribute;\r
+import com.unboundid.ldap.sdk.DereferencePolicy;\r
import com.unboundid.ldap.sdk.ExtendedResult;\r
import com.unboundid.ldap.sdk.LDAPConnection;\r
import com.unboundid.ldap.sdk.LDAPException;\r
import com.unboundid.ldap.sdk.LDAPSearchException;\r
import com.unboundid.ldap.sdk.ResultCode;\r
+import com.unboundid.ldap.sdk.SearchRequest;\r
import com.unboundid.ldap.sdk.SearchResult;\r
import com.unboundid.ldap.sdk.SearchResultEntry;\r
import com.unboundid.ldap.sdk.SearchScope;\r
for (Attribute userAttribute : loggingInUser.getAttributes())\r
groupMemberPattern = StringUtils.replace(groupMemberPattern, "${" + userAttribute.getName() + "}", escapeLDAPSearchFilter(userAttribute.getValue()));\r
\r
- SearchResult teamMembershipResult = doSearch(ldapConnection, groupBase, groupMemberPattern);\r
+ SearchResult teamMembershipResult = doSearch(ldapConnection, groupBase, true, groupMemberPattern, Arrays.asList("cn"));\r
if (teamMembershipResult != null && teamMembershipResult.getEntryCount() > 0) {\r
for (int i = 0; i < teamMembershipResult.getEntryCount(); i++) {\r
SearchResultEntry teamEntry = teamMembershipResult.getSearchEntries().get(i);\r
return null;\r
}\r
}\r
+ \r
+ private SearchResult doSearch(LDAPConnection ldapConnection, String base, boolean dereferenceAliases, String filter, List<String> attributes) {\r
+ try {\r
+ SearchRequest searchRequest = new SearchRequest(base, SearchScope.SUB, filter);\r
+ if ( dereferenceAliases ) {\r
+ searchRequest.setDerefPolicy(DereferencePolicy.SEARCHING);\r
+ }\r
+ if (attributes != null) {\r
+ searchRequest.setAttributes(attributes);\r
+ }\r
+ return ldapConnection.search(searchRequest);\r
+\r
+ } catch (LDAPSearchException e) {\r
+ logger.error("Problem Searching LDAP", e);\r
\r
+ return null;\r
+ } catch (LDAPException e) {\r
+ logger.error("Problem creating LDAP search", e);\r
+ return null;\r
+ }\r
+ }\r
+ \r
private boolean isAuthenticated(LDAPConnection ldapConnection, String userDn, String password) {\r
try {\r
// Binding will stop any LDAP-Injection Attacks since the searched-for user needs to bind to that DN\r