2022-07-23 23:45:48 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module CommitSignatures
|
|
|
|
class SshSignature < ApplicationRecord
|
|
|
|
include CommitSignature
|
2023-03-04 22:38:38 +05:30
|
|
|
include SignatureType
|
2022-07-23 23:45:48 +05:30
|
|
|
|
2022-08-27 11:52:29 +05:30
|
|
|
belongs_to :key, optional: true
|
2023-03-17 16:20:25 +05:30
|
|
|
belongs_to :user, optional: true
|
2023-03-04 22:38:38 +05:30
|
|
|
|
|
|
|
def type
|
|
|
|
:ssh
|
|
|
|
end
|
|
|
|
|
|
|
|
def signed_by_user
|
2023-03-17 16:20:25 +05:30
|
|
|
user || key&.user
|
|
|
|
end
|
|
|
|
|
|
|
|
def key_fingerprint_sha256
|
|
|
|
super || key&.fingerprint_sha256
|
2023-03-04 22:38:38 +05:30
|
|
|
end
|
2022-07-23 23:45:48 +05:30
|
|
|
end
|
|
|
|
end
|