Files
gitlabhq/lib/api/ldap.rb
T
Jan-Willem van der Meer c1865b69cd Fix merge conflicts
Due to the complicated merge, part of the new functionalilty is inserted here
2014-10-14 23:41:07 +02:00

22 lines
668 B
Ruby

module API
# groups API
class Ldap < Grape::API
before { authenticate! }
resource :ldap do
# Get a LDAP groups list. Limit size to 20 of them.
# Filter results by name using search param
#
# Example Request:
# GET /ldap/groups
get 'groups' do
# NOTE: this should be deprecated in favour of /ldap/PROVIDER_NAME/groups
# for now we just select the first LDAP server
provider = Gitlab::LDAP::Config.servers.first['provider_name']
@groups = Gitlab::LDAP::Adapter.new(provider).groups("#{params[:search]}*", 20)
present @groups, with: Entities::LdapGroup
end
end
end
end