cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From koushik-das <...@git.apache.org>
Subject [GitHub] cloudstack pull request: CLOUDSTACK-8596 ability to query nested g...
Date Thu, 23 Jul 2015 05:47:13 GMT
Github user koushik-das commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/609#discussion_r35291585
  
    --- Diff: plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/ADLdapUserManagerImpl.java
---
    @@ -0,0 +1,81 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.cloudstack.ldap;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import javax.naming.NamingEnumeration;
    +import javax.naming.NamingException;
    +import javax.naming.directory.SearchControls;
    +import javax.naming.directory.SearchResult;
    +import javax.naming.ldap.LdapContext;
    +
    +import org.apache.commons.lang.StringUtils;
    +import org.apache.log4j.Logger;
    +
    +public class ADLdapUserManagerImpl extends OpenLdapUserManagerImpl implements LdapUserManager
{
    +    public static final Logger s_logger = Logger.getLogger(ADLdapUserManagerImpl.class.getName());
    +
    +    @Override
    +    public List<LdapUser> getUsersInGroup(String groupName, LdapContext context)
throws NamingException {
    +        final SearchControls searchControls = new SearchControls();
    +        searchControls.setSearchScope(_ldapConfiguration.getScope());
    +        searchControls.setReturningAttributes(_ldapConfiguration.getReturnAttributes());
    +
    +        String basedn = _ldapConfiguration.getBaseDn();
    +        if (StringUtils.isBlank(basedn)) {
    +            throw new IllegalArgumentException("ldap basedn is not configured");
    --- End diff --
    
    Isn't Basedn a required config? In that case it should be validated while configuring
the ldap manager and not every time with these operations.  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message