Skip to content
Snippets Groups Projects
Commit 0f2616b3 authored by Douwe Maan's avatar Douwe Maan
Browse files

Merge branch 'ldap-group-links-api-doc-fix' into 'master'

Make the `provider` argument for the LDAP group links API endpoint required

Related to #329

If no `provider` is passed to the API endpoint, the group link is not created properly. Making it required fixes the issue temporarily. It should default to the first provider.

Next step, as mentioned in #329, is to do that.

/cc @job

See merge request !475
parents 644a5c3a 671b891e
No related branches found
No related tags found
3 merge requests!8889WIP: Port of 25624-anticipate-obstacles-to-removing-turbolinks to EE.,!7795Asciidoctor plantuml,!7793Add support for PlantUML diagrams in Asciidoc.
Loading
Loading
@@ -190,7 +190,7 @@ Parameters:
- `id` (required) - The ID of a group
- `cn` (required) - The CN of a LDAP group
- `group_access` (required) - Minimum access level for members of the LDAP group
- `provider` (optional) - LDAP provider for the LDAP group (when using several providers)
- `provider` (required) - LDAP provider for the LDAP group (when using several providers)
 
### Delete LDAP group link
 
Loading
Loading
Loading
Loading
@@ -11,14 +11,14 @@ module API
# id (required) - The ID of a group
# cn (required) - The CN of a LDAP group
# group_access (required) - Level of permissions for the linked LDAP group
# provider (optional) - the LDAP provider for this LDAP group
# provider (required) - the LDAP provider for this LDAP group
#
# Example Request:
# POST /groups/:id/ldap_group_links
post ":id/ldap_group_links" do
group = find_group(params[:id])
authorize! :admin_group, group
required_attributes! [:cn, :group_access]
required_attributes! [:cn, :group_access, :provider]
unless validate_access_level?(params[:group_access])
render_api_error!("Wrong group access level", 422)
end
Loading
Loading
Loading
Loading
@@ -51,7 +51,8 @@ describe API::API, api: true do
expect(json_response['provider']).to eq('ldap3')
end
 
it "should return ok and add ldap group link even if no provider specified" do
#TODO: Correct and activate this test once issue #329 is fixed
xit "should return ok and add ldap group link even if no provider specified" do
expect do
post api("/groups/#{group_with_ldap_links.id}/ldap_group_links", owner),
cn: 'ldap-group3', group_access: GroupMember::GUEST
Loading
Loading
@@ -79,7 +80,7 @@ describe API::API, api: true do
end
 
it "should return a 422 error when group access is not known" do
post api("//groups/#{group_with_ldap_links.id}/ldap_group_links", owner), cn: 'ldap-group3', group_access: 11
post api("//groups/#{group_with_ldap_links.id}/ldap_group_links", owner), cn: 'ldap-group3', group_access: 11, provider: 'ldap1'
expect(response.status).to eq(422)
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment