Errors when using the API to set application settings - import_sources, password_authentication
Summary
When trying to set all settings at once using the API, there are two errors thrown for the default settings (default, as in, exported from a fresh install):
{"error":"import_sources does not have a valid value, password_authentication_enabled_for_web, password_authentication_enabled, signin_enabled are mutually exclusive"}
Steps to reproduce
- Fresh install of latest version of GitLab (12.2.3 at the moment of reproducing this)
- Create a Personal Access Token
- Save the application settings JSON response from the API:
curl -H "PRIVATE-TOKEN: token" http://host/api/v4/application/settings > settings.json
- Attempt to PUT back the JSON through the API:
curl -H "PRIVATE-TOKEN: token" -X PUT -d @settings.json -H "Content-Type: application/json" http://host/api/v4/application/settings
Example Project
N/A
What is the current bug behavior?
An error is thrown because of two invalid field validations: import_sources in line 77, the api/settings file and the mutually_exclusive check on password_authentication_enabled_for_web, password_authentication_enabled, signin_enabled in line 94, the api/settings file
What is the expected correct behavior?
The settings should be applied without errors.
Relevant logs and/or screenshots
{"error":"import_sources does not have a valid value, password_authentication_enabled_for_web, password_authentication_enabled, signin_enabled are mutually exclusive"}
Possible fixes
For the import_sources error, it looks like the validated array is not up to date so it's likely just updating with the correct values here; but I don't know the context for the other error about the mutually_exclusive check on password_authentication_enabled_for_web, password_authentication_enabled, signin_enabled.