[go: up one dir, main page]

Skip to content

Cannot add SAML Group Link with minimal access via REST API

Summary

When using the REST API to add a group link you cannot set the access_level to minimal. Calling POST /groups/:id/saml_group_links with access_level to 5 causes an error access_level does not have a valid value.

The GitLab UI does not run into this error.

Steps to reproduce

  1. Create a group
  2. Try to add a SAML group link with access_level of 5 (minimal) via REST API
  3. Observe error

Example Project

What is the current bug behavior?

Calling something like:

curl --request POST --header "Content-Type: application/json" --data '{ "saml_group_name": "my_group", "access_level": 5 }' --url  "https://gitlab.com/api/v4/groups/$GROUPID/saml_group_links"

returns a 400 error code and the error:

access_level does not have a valid value

What is the expected correct behavior?

The correct behavior would be to create the SAML group link with the sent access level and not error.

Relevant logs and/or screenshots

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by 🤖 GitLab Bot 🤖