diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-10-06 13:36:20 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-10-06 13:36:20 +0000 |
commit | dd42cb5f8f4724fa899dae929975da78846f0950 (patch) | |
tree | 682d393b3e122b5fc988b78d3d188694ef317c12 /spec/factories | |
parent | 050548032475458a70005ed3f7ff74211084a423 (diff) | |
parent | 555f50b3e68e82968ea2eb4916a3f5beeeef7b31 (diff) | |
download | gitlab-ce-dd42cb5f8f4724fa899dae929975da78846f0950.tar.gz |
Merge branch '36829-gpg-commit-not-verified-if-signed-with-a-subkey' into 'master'
Add support for GPG subkeys in signature verification
Closes #36829
See merge request gitlab-org/gitlab-ce!14517
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/gpg_key_subkeys.rb | 10 | ||||
-rw-r--r-- | spec/factories/gpg_keys.rb | 4 | ||||
-rw-r--r-- | spec/factories/gpg_signature.rb | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/spec/factories/gpg_key_subkeys.rb b/spec/factories/gpg_key_subkeys.rb new file mode 100644 index 00000000000..66ecb44d84b --- /dev/null +++ b/spec/factories/gpg_key_subkeys.rb @@ -0,0 +1,10 @@ +require_relative '../support/gpg_helpers' + +FactoryGirl.define do + factory :gpg_key_subkey do + gpg_key + + sequence(:keyid) { |n| "keyid-#{n}" } + sequence(:fingerprint) { |n| "fingerprint-#{n}" } + end +end diff --git a/spec/factories/gpg_keys.rb b/spec/factories/gpg_keys.rb index 1258dce8940..93218e5763e 100644 --- a/spec/factories/gpg_keys.rb +++ b/spec/factories/gpg_keys.rb @@ -4,5 +4,9 @@ FactoryGirl.define do factory :gpg_key do key GpgHelpers::User1.public_key user + + factory :gpg_key_with_subkeys do + key GpgHelpers::User1.public_key_with_extra_signing_key + end end end diff --git a/spec/factories/gpg_signature.rb b/spec/factories/gpg_signature.rb index c0beecf0bea..e9798ff6a41 100644 --- a/spec/factories/gpg_signature.rb +++ b/spec/factories/gpg_signature.rb @@ -5,7 +5,7 @@ FactoryGirl.define do commit_sha { Digest::SHA1.hexdigest(SecureRandom.hex) } project gpg_key - gpg_key_primary_keyid { gpg_key.primary_keyid } + gpg_key_primary_keyid { gpg_key.keyid } verification_status :verified end end |