Skip to content
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

Merged
merged 3 commits into from Oct 6, 2017

Conversation

@CaeruleusAqua
Copy link
Contributor

@CaeruleusAqua CaeruleusAqua commented Oct 5, 2017

surround every mail in https://github.com/go-gitea/gitea/blob/master/models/gpg_key.go#L405
with strings.ToLower(email)

Fixes #2661

Signed-off-by: Julian Scholle <julian.scholle@googlemail.com>
@codecov-io
Copy link

@codecov-io codecov-io commented Oct 5, 2017

Codecov Report

Merging #2663 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
models/gpg_key.go 30.18% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ffab139...57d9397. Read the comment docs.

@tboerger tboerger added the lgtm/need 2 label Oct 5, 2017
@lafriks lafriks added the kind/bug label Oct 5, 2017
@lafriks lafriks added this to the 1.3.0 milestone Oct 5, 2017
@lafriks
Copy link
Member

@lafriks lafriks commented Oct 5, 2017

LGTM

@tboerger tboerger added lgtm/need 1 and removed lgtm/need 2 labels Oct 5, 2017
@@ -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) {

This comment has been minimized.

@sapk

sapk Oct 6, 2017
Member

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>
@sapk
sapk approved these changes Oct 6, 2017
@sapk
Copy link
Member

@sapk sapk commented Oct 6, 2017

LGTM. Thanks for doing it.

@tboerger tboerger added lgtm/done and removed lgtm/need 1 labels Oct 6, 2017
@lafriks lafriks merged commit 92123fe into go-gitea:master Oct 6, 2017
2 checks passed
2 checks passed
approvals/lgtm this commit looks good
continuous-integration/drone/pr the build was successful
Details
sapk added a commit to sapk-fork/gitea that referenced this pull request Oct 26, 2017
…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>
lunny added a commit that referenced this pull request Oct 27, 2017
* 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>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.