summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorKevin O'Connor <kevin.oconnor7@gmail.com>2017-02-14 19:01:30 -0500
committerAlexis Reigel <mail@koffeinfrei.org>2017-07-27 15:40:40 +0200
commit817d9558febde484f23f623bd66d8c861ebc8236 (patch)
tree7ebb73c3a019d9999abcd92bdb560ac4caf4f223 /app/models/commit.rb
parent4eebd8e1957a3fc3a3479331fde9f34aa8afa9d5 (diff)
downloadgitlab-ce-817d9558febde484f23f623bd66d8c861ebc8236.tar.gz
Prototype key verification
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 1e19f00106a..b22aaa3c461 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -234,6 +234,18 @@ class Commit
@statuses[ref] = pipelines.latest_status(ref)
end
+ def signature
+ return @signature if defined?(@signature)
+
+ sig, signed = @raw.extract_signature(project.repository.raw_repository)
+ if sig && signed
+ GPGME::Crypto.new.verify(sig, signed_text: signed) do |sign|
+ @signature = sign
+ end
+ end
+ @signature ||= nil
+ end
+
def revert_branch_name
"revert-#{short_id}"
end