summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-02-22 18:49:03 +0100
committerRémy Coutable <remy@rymai.me>2017-02-22 18:49:03 +0100
commit0567e3efd17365b2f89039122344e3fa0d85f322 (patch)
tree6eb4155f36fe4e368b2424a81a69e13b4e8225a4
parent4561aaba597e2383257c21a706b4f3ad86bc637e (diff)
downloadgitlab-ce-0567e3efd17365b2f89039122344e3fa0d85f322.tar.gz
Use Gitlab::SSHPublicKey.technology_names
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--app/helpers/application_settings_helper.rb2
-rw-r--r--app/models/application_setting.rb2
-rw-r--r--lib/api/settings.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb
index d0af5583de4..e08662afbec 100644
--- a/app/helpers/application_settings_helper.rb
+++ b/app/helpers/application_settings_helper.rb
@@ -94,7 +94,7 @@ module ApplicationSettingsHelper
end
def allowed_key_types_checkboxes(help_block_id)
- Gitlab::SSHPublicKey::TYPES.map do |type|
+ Gitlab::SSHPublicKey.technology_names.map do |type|
checked = current_application_settings.allowed_key_types.include?(type)
checkbox_id = "allowed_key_types-#{type}"
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index 77582df2a48..0283606694e 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -186,7 +186,7 @@ class ApplicationSetting < ActiveRecord::Base
{
after_sign_up_text: nil,
akismet_enabled: false,
- allowed_key_types: Gitlab::SSHPublicKey::TYPES,
+ allowed_key_types: Gitlab::SSHPublicKey.technology_names,
container_registry_token_expire_delay: 5,
default_branch_protection: Settings.gitlab['default_branch_protection'],
default_project_visibility: Settings.gitlab.default_projects_features['visibility_level'],
diff --git a/lib/api/settings.rb b/lib/api/settings.rb
index 5a72960b0f3..03fa06c722b 100644
--- a/lib/api/settings.rb
+++ b/lib/api/settings.rb
@@ -111,7 +111,7 @@ module API
optional :terminal_max_session_time, type: Integer, desc: 'Maximum time for web terminal websocket connection (in seconds). Set to 0 for unlimited time.'
optional :minimum_rsa_bits, type: Integer, desc: 'The minimum allowed bit length of an uploaded RSA key.'
optional :minimum_ecdsa_bits, type: Integer, desc: 'The minimum allowed curve size (in bits) of an uploaded ECDSA key.'
- optional :allowed_key_types, type: Array[String], values: Gitlab::SSHPublicKey::TYPES, desc: 'The SSH key types accepted by the application (`rsa`, `dsa`, or `ecdsa`).'
+ optional :allowed_key_types, type: Array[String], values: Gitlab::SSHPublicKey.technology_names, desc: 'The SSH key types accepted by the application (`rsa`, `dsa`, or `ecdsa`).'
at_least_one_of :default_branch_protection, :default_project_visibility, :default_snippet_visibility,
:default_group_visibility, :restricted_visibility_levels, :import_sources,