diff options
author | Nick Thomas <nick@gitlab.com> | 2017-08-21 11:30:03 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-08-30 20:50:44 +0100 |
commit | b0f982fbdf69c292ab4530c0aaaf1ab42f4e7a01 (patch) | |
tree | 0d76c74fb6260de1e3c9694a8501491b2eb486ef /app/helpers/application_settings_helper.rb | |
parent | 81f08d30e641dc1a6666022ab1f5d36dbcdced7e (diff) | |
download | gitlab-ce-b0f982fbdf69c292ab4530c0aaaf1ab42f4e7a01.tar.gz |
Add settings for minimum key strength and allowed key type
This is an amalgamation of:
* Cory Hinshaw: Initial implementation !5552
* Rémy Coutable: Updates !9350
* Nick Thomas: Resolve conflicts and add ED25519 support !13712
Diffstat (limited to 'app/helpers/application_settings_helper.rb')
-rw-r--r-- | app/helpers/application_settings_helper.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 3b76da238e0..75d090359d0 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -81,6 +81,20 @@ module ApplicationSettingsHelper end end + def allowed_key_types_checkboxes(help_block_id) + Gitlab::SSHPublicKey.technology_names.map do |type| + checked = current_application_settings.allowed_key_types.include?(type) + checkbox_id = "allowed_key_types-#{type}" + + label_tag(checkbox_id, class: checked ? 'active' : nil) do + check_box_tag('application_setting[allowed_key_types][]', type, checked, + autocomplete: 'off', + 'aria-describedby' => help_block_id, + id: checkbox_id) + type.upcase + end + end + end + def repository_storages_options_for_select options = Gitlab.config.repositories.storages.map do |name, storage| ["#{name} - #{storage['path']}", name] @@ -141,6 +155,10 @@ module ApplicationSettingsHelper :metrics_port, :metrics_sample_interval, :metrics_timeout, + :minimum_dsa_bits, + :minimum_ecdsa_bits, + :minimum_ed25519_bits, + :minimum_rsa_bits, :password_authentication_enabled, :performance_bar_allowed_group_id, :performance_bar_enabled, |