diff options
author | Robert Speicher <robert@gitlab.com> | 2017-09-01 22:23:08 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-09-01 22:23:08 +0300 |
commit | 223849fa173b7059e717ba4f9c02075a452cbd49 (patch) | |
tree | 19dd9e840010234164a4461ac081889c07e05c9a /spec/features/profiles | |
parent | dd825c0f5d00cef3cac89480bcf2027064c5d89d (diff) | |
parent | 29b40db58944a32db6cf1ae9906653a2e5f4be9d (diff) |
Merge branch '17849-allow-admin-to-restrict-min-key-length-and-techno' into 'master'
Add settings for minimum key strength and allowed key type
Closes #17849
See merge request !13712
Diffstat (limited to 'spec/features/profiles')
-rw-r--r-- | spec/features/profiles/keys_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/features/profiles/keys_spec.rb b/spec/features/profiles/keys_spec.rb index 6541ea6bf57..aa71c4dbba4 100644 --- a/spec/features/profiles/keys_spec.rb +++ b/spec/features/profiles/keys_spec.rb @@ -28,6 +28,23 @@ feature 'Profile > SSH Keys' do expect(page).to have_content("Title: #{attrs[:title]}") expect(page).to have_content(attrs[:key]) end + + context 'when only DSA and ECDSA keys are allowed' do + before do + forbidden = ApplicationSetting::FORBIDDEN_KEY_VALUE + stub_application_setting(rsa_key_restriction: forbidden, ed25519_key_restriction: forbidden) + end + + scenario 'shows a validation error' do + attrs = attributes_for(:key) + + fill_in('Key', with: attrs[:key]) + fill_in('Title', with: attrs[:title]) + click_button('Add key') + + expect(page).to have_content('Key type is forbidden. Must be DSA or ECDSA') + end + end end scenario 'User sees their keys' do |