diff options
author | Mathieu Parent <math.parent@gmail.com> | 2019-07-25 16:10:30 +0300 |
---|---|---|
committer | Mathieu Parent <math.parent@gmail.com> | 2019-09-09 16:14:52 +0300 |
commit | 85776fa3ffba6f641cf981cb0107f0e4ba882f3e (patch) | |
tree | dd571294c8ee15639c371c1a0f6a71799eea632e /lib/api | |
parent | ea14d17da4d3625eaf6a70a3b38660e5753c5f77 (diff) |
Settings API: domain_{black,white}list should be arrays
As in documentation.
Fixes: #58180.
Also remove the requirement between domain_blacklist_enabled and domain_blacklist.
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/settings.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/api/settings.rb b/lib/api/settings.rb index d4bf3f3ac95..acf03051a5b 100644 --- a/lib/api/settings.rb +++ b/lib/api/settings.rb @@ -50,10 +50,8 @@ module API optional :default_snippet_visibility, type: String, values: Gitlab::VisibilityLevel.string_values, desc: 'The default snippet visibility' optional :disabled_oauth_sign_in_sources, type: Array[String], desc: 'Disable certain OAuth sign-in sources' optional :domain_blacklist_enabled, type: Boolean, desc: 'Enable domain blacklist for sign ups' - given domain_blacklist_enabled: ->(val) { val } do - requires :domain_blacklist, type: String, desc: 'Users with e-mail addresses that match these domain(s) will NOT be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com' - end - optional :domain_whitelist, type: String, desc: 'ONLY users with e-mail addresses that match these domain(s) will be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com' + optional :domain_blacklist, type: Array[String], coerce_with: Validations::Types::CommaSeparatedToArray.coerce, desc: 'Users with e-mail addresses that match these domain(s) will NOT be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com' + optional :domain_whitelist, type: Array[String], coerce_with: Validations::Types::CommaSeparatedToArray.coerce, desc: 'ONLY users with e-mail addresses that match these domain(s) will be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com' optional :email_author_in_body, type: Boolean, desc: 'Some email servers do not support overriding the email sender name. Enable this option to include the name of the author of the issue, merge request or comment in the email body instead.' optional :enabled_git_access_protocol, type: String, values: %w[ssh http nil], desc: 'Allow only the selected protocols to be used for Git access.' optional :gitaly_timeout_default, type: Integer, desc: 'Default Gitaly timeout, in seconds. Set to 0 to disable timeouts.' |