[PR #2266] [MERGED] Only check at least one email gpg key #16316

Closed
opened 2025-11-02 12:07:31 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2266
Author: @sapk
Created: 8/6/2017
Status: Merged
Merged: 9/5/2017
Merged by: @lunny

Base: masterHead: only-check-at-least-on-email-gpg-key


📝 Commits (10+)

📊 Changes

36 files changed (+851 additions, -24 deletions)

View changed files

integrations/api_gpg_keys_test.go (+260 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/HEAD (+1 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/config (+4 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/description (+1 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/applypatch-msg.sample (+15 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/commit-msg.sample (+24 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/post-update.sample (+8 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/pre-applypatch.sample (+14 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/pre-commit.sample (+49 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/pre-push.sample (+53 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/pre-rebase.sample (+169 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/pre-receive.sample (+24 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/prepare-commit-msg.sample (+36 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/update.sample (+128 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/info/exclude (+6 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/objects/0c/3d59dea27b97aa3cb66072745d7a2c51a7a8b1 (+0 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/objects/24/f83a471f77579fea57bac7255d6e64e70fce1c (+0 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/objects/27/566bd5738fc8b4e3fef3c5e72cce608537bd95 (+0 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/objects/3b/2b54fe3d9a8279d5b926124dccdf279b8eff2f (+1 -0)
integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/objects/45/8121ce9a6b855c9733bae62093caf3f39685de (+0 -0)

...and 16 more files

📄 Description

Fix #2213 & #2187 by relaxing the control on import by allowing any key with one key at least matching one email of the user.

Commit validation should stilll be good because I use GetUserByEmail to get the user from commiter email and this method need that the email is activated. And add an extra checkup and optimization by checking before checking sign if the emails attached to the key can validate this particular email of commiter.

Still to do :

  • ~~~Add integration tests for validation of commit to check corner case.~~~
Extra : Command line to test this : go test -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite' && GITEA_ROOT="$GOPATH/src/code.gitea.io/gitea" GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.v -test.run GPG

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2266 **Author:** [@sapk](https://github.com/sapk) **Created:** 8/6/2017 **Status:** ✅ Merged **Merged:** 9/5/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `only-check-at-least-on-email-gpg-key` --- ### 📝 Commits (10+) - [`7c0a863`](https://github.com/go-gitea/gitea/commit/7c0a863fca5ef8f298011a0ffa70c2966a3e2579) Only require one email (possibly not yet validated) - [`55803ad`](https://github.com/go-gitea/gitea/commit/55803add8c6d67730e3855a4913155e6f3b2f780) Update message error and check validation of commit - [`a58bc04`](https://github.com/go-gitea/gitea/commit/a58bc04b877634d5e794bd9f7dcd8ec6716741d5) Add integrations tests - [`9d4acb1`](https://github.com/go-gitea/gitea/commit/9d4acb1a88e5ed5a87ed54c663c1ce11c579ec24) Complete integration for import - [`4775722`](https://github.com/go-gitea/gitea/commit/4775722e8707831e7c501c7371cd68178947a47a) Add pre-check/optimization - [`f54b5a3`](https://github.com/go-gitea/gitea/commit/f54b5a38d82d32700d2dac32ccda230a88a07744) Add some test (not finished) - [`dd5d7f1`](https://github.com/go-gitea/gitea/commit/dd5d7f107bf9ec9c68deed1633a61617b7535f5f) Finish - [`b567a86`](https://github.com/go-gitea/gitea/commit/b567a86bf40e5b1d0803e89fff349553e18535d2) Fix fixtures - [`831329f`](https://github.com/go-gitea/gitea/commit/831329f1c56482342e12b1b631c4265601bfad68) Fix typo - [`b3cc631`](https://github.com/go-gitea/gitea/commit/b3cc631b013948d4dbda923104effaf02d44e53c) Don't guess key ID ### 📊 Changes **36 files changed** (+851 additions, -24 deletions) <details> <summary>View changed files</summary> ➕ `integrations/api_gpg_keys_test.go` (+260 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/HEAD` (+1 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/config` (+4 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/description` (+1 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/applypatch-msg.sample` (+15 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/commit-msg.sample` (+24 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/post-update.sample` (+8 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/pre-applypatch.sample` (+14 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/pre-commit.sample` (+49 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/pre-push.sample` (+53 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/pre-rebase.sample` (+169 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/pre-receive.sample` (+24 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/prepare-commit-msg.sample` (+36 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/hooks/update.sample` (+128 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/info/exclude` (+6 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/objects/0c/3d59dea27b97aa3cb66072745d7a2c51a7a8b1` (+0 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/objects/24/f83a471f77579fea57bac7255d6e64e70fce1c` (+0 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/objects/27/566bd5738fc8b4e3fef3c5e72cce608537bd95` (+0 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/objects/3b/2b54fe3d9a8279d5b926124dccdf279b8eff2f` (+1 -0) ➕ `integrations/gitea-integration-meta/gitea-repositories/user2/repo16.git/objects/45/8121ce9a6b855c9733bae62093caf3f39685de` (+0 -0) _...and 16 more files_ </details> ### 📄 Description Fix #2213 & #2187 by relaxing the control on import by allowing any key with one key at least matching one email of the user. Commit validation should stilll be good because I use GetUserByEmail to get the user from commiter email and this method need that the email is activated. And add an extra checkup and optimization by checking before checking sign if the emails attached to the key can validate this particular email of commiter. Still to do : - [x] ~~~Add integration tests for validation of commit to check corner case.~~~ <details> <summary>Extra : </summary> Command line to test this : <code>go test -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite' && GITEA_ROOT="$GOPATH/src/code.gitea.io/gitea" GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.v -test.run GPG</code> </details --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:07:31 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16316