Skip to content
Snippets Groups Projects
Commit 29b40db5 authored by Nick Thomas's avatar Nick Thomas
Browse files

More review comments

parent eb05bdc6
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -3,7 +3,6 @@ module FormHelper
return unless model.errors.any?
 
pluralized = 'error'.pluralize(model.errors.count)
headline = "The #{type} contains the following #{pluralized}:"
 
content_tag(:div, class: 'alert alert-danger', id: 'error_explanation') do
Loading
Loading
Loading
Loading
@@ -155,6 +155,8 @@ class ApplicationSetting < ActiveRecord::Base
validates :"#{type}_key_restriction", presence: true, key_restriction: { type: type }
end
 
validates :allowed_key_types, presence: true
validates_each :restricted_visibility_levels do |record, attr, value|
value&.each do |level|
unless Gitlab::VisibilityLevel.options.value?(level)
Loading
Loading
Loading
Loading
@@ -3,8 +3,8 @@
- if key.valid?
= icon 'key', class: 'settings-list-icon hidden-xs'
- else
= icon 'exclamation-triangle', class: 'settings-list-icon hidden-xs',
title: 'The key is disabled because it is invalid'
= icon 'exclamation-triangle', class: 'settings-list-icon hidden-xs has-tooltip',
title: key.errors.full_messages.join(', ')
 
 
.key-list-item-info
Loading
Loading
doc/security/img/ssh_keys_restrictions_settings.png

13.4 KiB | W: 993px | H: 203px

doc/security/img/ssh_keys_restrictions_settings.png

66.9 KiB | W: 2638px | H: 424px

doc/security/img/ssh_keys_restrictions_settings.png
doc/security/img/ssh_keys_restrictions_settings.png
doc/security/img/ssh_keys_restrictions_settings.png
doc/security/img/ssh_keys_restrictions_settings.png
  • 2-up
  • Swipe
  • Onion skin
Loading
Loading
@@ -77,6 +77,15 @@ describe ApplicationSetting do
expect(described_class::SUPPORTED_KEY_TYPES).to contain_exactly(:rsa, :dsa, :ecdsa, :ed25519)
end
 
it 'does not allow all key types to be disabled' do
described_class::SUPPORTED_KEY_TYPES.each do |type|
setting["#{type}_key_restriction"] = described_class::FORBIDDEN_KEY_VALUE
end
expect(setting).not_to be_valid
expect(setting.errors.messages).to have_key(:allowed_key_types)
end
where(:type) do
described_class::SUPPORTED_KEY_TYPES
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment