mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-24 05:33:40 +09:00
Backport #10425 Backport #10511 * Show Signer in commit lists and add basic trust (#10425) Show the avatar of the signer in the commit list pages as we do not enforce that the signer is an author or committer. This makes it clearer who has signed the commit. Also display commits signed by non-members differently from members and in particular make it clear when a non-member signer is different from the committer to help reduce the risk of spoofing. Signed-off-by: Andrew Thornton <art27@cantab.net> Fix the signing icon in the view_list.tmpl page (#10511) Co-Authored-By: silverwind <me@silverwind.io> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
This commit is contained in:
co-authored by
silverwind
guillep2k
parent
11300ee582
commit
caa2aeaa52
@@ -15,17 +15,28 @@
|
||||
<strong>{{.LatestCommit.Author.Name}}</strong>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<a rel="nofollow" class="ui sha label {{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified }} isVerified {{end}}{{end}}" href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}">
|
||||
{{ShortSha .LatestCommit.ID.String}}
|
||||
<a rel="nofollow" class="ui sha label {{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified }} isVerified{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}Untrusted{{else}}Unmatched{{end}}{{else if .LatestCommitVerification.Warning}} isWarning{{end}}{{end}}" href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}">
|
||||
<span class="shortsha">{{ShortSha .LatestCommit.ID.String}}</span>
|
||||
<div class="ui detail icon button">
|
||||
{{if .LatestCommit.Signature}}
|
||||
<div class="ui detail icon button">
|
||||
{{if .LatestCommitVerification.Verified}}
|
||||
<i title="{{.LatestCommitVerification.Reason}}" class="lock green icon"></i>
|
||||
{{else}}
|
||||
<i title="{{$.i18n.Tr .LatestCommitVerification.Reason}}" class="unlock icon"></i>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if .LatestCommitVerification.Verified}}
|
||||
<div title="{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}{{.i18n.Tr "repo.commits.signed_by_untrusted_user"}}: {{else}}{{.i18n.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}: {{end}}{{.LatestCommitVerification.Reason}}">
|
||||
{{if ne .LatestCommitVerification.SigningUser.ID 0}}
|
||||
<i class="lock icon"></i>
|
||||
<img class="ui signature avatar image" src="{{.LatestCommitVerification.SigningUser.RelAvatarLink}}" />
|
||||
{{else}}
|
||||
<i title="{{.LatestCommitVerification.Reason}}" class="icons">
|
||||
<i class="lock icon"></i>
|
||||
<i class="tiny inverted cog icon centerlock"></i>
|
||||
</i>
|
||||
<img class="ui signature avatar image" src="{{AvatarLink .LatestCommitVerification.SigningEmail}}" />
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
<i title="{{$.i18n.Tr .LatestCommitVerification.Reason}}" class="unlock icon"></i>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</a>
|
||||
{{template "repo/commit_status" .LatestCommitStatus}}
|
||||
{{ $commitLink:= printf "%s/commit/%s" .RepoLink .LatestCommit.ID }}
|
||||
|
||||
Reference in New Issue
Block a user