summaryrefslogtreecommitdiff
path: root/lib/api/entities/commit_signature.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-03 18:10:03 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-03 18:10:03 +0000
commitb6847c621ff246e6abceb90545d5a608318762d6 (patch)
tree460da2a6c2be2e4f5164c2bba1851b66260f850d /lib/api/entities/commit_signature.rb
parentc08d9c22569d1c9e7c7737e183969593394133d9 (diff)
downloadgitlab-ce-b6847c621ff246e6abceb90545d5a608318762d6.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/entities/commit_signature.rb')
-rw-r--r--lib/api/entities/commit_signature.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/api/entities/commit_signature.rb b/lib/api/entities/commit_signature.rb
index 8e86d4c1aa6..b5232273521 100644
--- a/lib/api/entities/commit_signature.rb
+++ b/lib/api/entities/commit_signature.rb
@@ -3,10 +3,14 @@
module API
module Entities
class CommitSignature < Grape::Entity
- expose :gpg_key_id
- expose :gpg_key_primary_keyid, :gpg_key_user_name, :gpg_key_user_email
- expose :verification_status
- expose :gpg_key_subkey_id
+ expose :signature_type
+ expose :signature, merge: true do |commit, options|
+ if commit.signature.is_a?(GpgSignature)
+ ::API::Entities::GpgCommitSignature.represent commit.signature, options
+ elsif commit.signature.is_a?(X509CommitSignature)
+ ::API::Entities::X509Signature.represent commit.signature, options
+ end
+ end
end
end
end