forked from forgejo/forgejo
[GITEA] Add noreply email address as verified for SSH signed Git commits
- When someone really wants to avoid sharing their email, they could configure git to use the noreply email for git commits. However if they also wanted to use SSH signing, it would not show up as verified as the noreply email address was technically not an activated email address for the user. - Add unit tests for the `ParseCommitWithSSHSignature` function. - Resolves https://codeberg.org/Codeberg/Community/issues/946 (cherry picked from commit1685de7eba
) (cherry picked from commitb1e8858de9
) (cherry picked from commit1a6bf24d28
) (cherry picked from commit0122943345
) (cherry picked from commitcc83614853
) (cherry picked from commit429febe0dc
) (cherry picked from commit58a9c2ebe9
) (cherry picked from commitfef94aff1c
) (cherry picked from commit5c6ecd7579
) (cherry picked from commitffa33a82bf
) (cherry picked from commita97de1d5bb
) (cherry picked from commit57ab2b4a40
)
This commit is contained in:
parent
295cd6be94
commit
6f8fc9392c
4 changed files with 166 additions and 0 deletions
|
@ -39,6 +39,12 @@ func ParseCommitWithSSHSignature(ctx context.Context, c *git.Commit, committer *
|
|||
log.Error("GetEmailAddresses: %v", err)
|
||||
}
|
||||
|
||||
// Add the noreply email address as verified address.
|
||||
committerEmailAddresses = append(committerEmailAddresses, &user_model.EmailAddress{
|
||||
IsActivated: true,
|
||||
Email: committer.GetPlaceholderEmail(),
|
||||
})
|
||||
|
||||
activated := false
|
||||
for _, e := range committerEmailAddresses {
|
||||
if e.IsActivated && strings.EqualFold(e.Email, c.Committer.Email) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue