diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-30 21:09:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-30 21:09:30 +0300 |
commit | 370736438075748c36abd7fd7dd32a8ef98048f9 (patch) | |
tree | d74dd4529092edeb7dcb914bf0311f962d89e7bb /spec/factories | |
parent | e7b262a4c5cf70fed6eb25ba7a0eb1336e6eb639 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/keys.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/factories/keys.rb b/spec/factories/keys.rb index a7478ce2657..ccf835fe56e 100644 --- a/spec/factories/keys.rb +++ b/spec/factories/keys.rb @@ -3,8 +3,13 @@ FactoryBot.define do factory :key do title - key { SSHData::PrivateKey::RSA.generate(1024, unsafe_allow_small_key: true).public_key.openssh(comment: 'dummy@gitlab.com') } - + key do + # Larger keys take longer to generate, and since this factory gets called frequently, + # let's only create the smallest one we need. + SSHData::PrivateKey::RSA.generate( + ::Gitlab::SSHPublicKey.supported_sizes(:rsa).min, unsafe_allow_small_key: true + ).public_key.openssh(comment: 'dummy@gitlab.com') + end trait :expired do to_create { |key| key.save!(validate: false) } expires_at { 2.days.ago } @@ -16,7 +21,7 @@ FactoryBot.define do end factory :key_without_comment do - key { SSHData::PrivateKey::RSA.generate(1024, unsafe_allow_small_key: true).public_key.openssh } + key { SSHData::PrivateKey::RSA.generate(3072, unsafe_allow_small_key: true).public_key.openssh } end factory :deploy_key, class: 'DeployKey' |