New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPG key email verification no longer case sensitive (#2661) #2663
Conversation
Signed-off-by: Julian Scholle <julian.scholle@googlemail.com>
Codecov Report
@@ Coverage Diff @@
## master #2663 +/- ##
==========================================
- Coverage 27.13% 27.13% -0.01%
==========================================
Files 86 86
Lines 17061 17062 +1
==========================================
Hits 4629 4629
- Misses 11754 11755 +1
Partials 678 678
Continue to review full report at Codecov.
|
LGTM |
models/gpg_key.go
Outdated
@@ -402,7 +402,7 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification { | |||
//Pre-check (& optimization) that emails attached to key can be attached to the commiter email and can validate | |||
canValidate := false | |||
for _, e := range k.Emails { | |||
if e.IsActivated && e.Email == c.Committer.Email { | |||
if e.IsActivated && strings.ToLower(e.Email) == strings.ToLower(c.Committer.Email) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For little performance improvement, strings.ToLower(c.Committer.Email)
could be cached inside a var like lowerCommiterEmail := strings.ToLower(c.Committer.Email)
before for _, k := range keys {
Signed-off-by: Julian Scholle <julian.scholle@googlemail.com>
LGTM. Thanks for doing it. |
…o-gitea#2663) * GPG key email verification no longer case sensitive (go-gitea#2661) * case insensitive GPG key email verification now cached (go-gitea#2661) Signed-off-by: Julian Scholle <julian.scholle@googlemail.com>
* Only check at least one email gpg key (#2266) * Only require one email (possibly not yet validated) * Update message error and check validation of commit * Add integrations tests * Complete integration for import * Add pre-check/optimization * Add some test (not finished) * Finish * Fix fixtures * Fix typo * Don't guess key ID * Make repo private to no interfere with other tests (#2467) * GPG key email verification no longer case sensitive (#2661) (#2663) * GPG key email verification no longer case sensitive (#2661) * case insensitive GPG key email verification now cached (#2661) Signed-off-by: Julian Scholle <julian.scholle@googlemail.com>
surround every mail in https://github.com/go-gitea/gitea/blob/master/models/gpg_key.go#L405
with strings.ToLower(email)
Fixes #2661