-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix gpg key deletion #14561
Merged
Merged
Fix gpg key deletion #14561
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Per go-gitea#14531, deleting a user account will delete the user's GPG keys from the `gpg_key` table but not from `gpg_key_import`, which causes an error when creating an account with the same email and attempting to re-add the same key. This commit deletes all entries from `gpg_key_import` that match any GPG key IDs belonging to the user.
6543
reviewed
Feb 4, 2021
GiteaBot
added
the
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
label
Feb 4, 2021
Create a new function `listGPGKeys` and replace a previous use of `ListGPGKeys`. Thanks to @6543 for the patch.
6543
approved these changes
Feb 4, 2021
GiteaBot
added
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
and removed
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
labels
Feb 4, 2021
lunny
approved these changes
Feb 4, 2021
GiteaBot
added
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
and removed
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
labels
Feb 4, 2021
We also needs a doctor command to correct history wrong data. |
Please send backport to v1.13 |
anton-khimich
pushed a commit
to anton-khimich/gitea
that referenced
this pull request
Feb 4, 2021
Per go-gitea#14531, deleting a user account will delete the user's GPG keys from the `gpg_key` table but not from `gpg_key_import`, which causes an error when creating an account with the same email and attempting to re-add the same key. This commit deletes all entries from `gpg_key_import` that match any GPG key IDs belonging to the user.
6543
pushed a commit
that referenced
this pull request
Feb 4, 2021
Per #14531, deleting a user account will delete the user's GPG keys from the `gpg_key` table but not from `gpg_key_import`, which causes an error when creating an account with the same email and attempting to re-add the same key. This commit deletes all entries from `gpg_key_import` that match any GPG key IDs belonging to the user. Co-authored-by: Anton Khimich <[email protected]>
a1012112796
added a commit
to a1012112796/gitea
that referenced
this pull request
Feb 9, 2021
* master: (22 commits) Add support for ref parameter to get raw file API (go-gitea#14602) Fixed irritating error message related to go version (go-gitea#14611) Use OldRef instead of CommitSHA for DeleteBranch comments (go-gitea#14604) Add information on how to build statically (go-gitea#14594) [skip ci] Updated translations via Crowdin Exclude the current dump file from the dump (go-gitea#14606) Remove spurious DataAsync Error logging (go-gitea#14599) [API] Add delete release by tag & fix unreleased inconsistency (go-gitea#14563) Fix rate limit bug when downloading assets on migrating from github (go-gitea#14564) [API] Add affected files of commits to commit struct (go-gitea#14579) [skip ci] Updated licenses and gitignores Fix locale init (go-gitea#14582) Add Content-Length header to HEAD requests (go-gitea#14542) Honor REGISTER_MANUAL_CONFIRM when doing openid registration (go-gitea#14548) Fix lfs file viewer (go-gitea#14568) Fix typo in generate-emoji.go (go-gitea#14570) Fix bug about ListOptions and stars/watchers pagnation (go-gitea#14556) Fix gpg key deletion (go-gitea#14561) [API] GetRelease by tag only return release (go-gitea#14397) Reduce data races (go-gitea#14549) ...
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
backport/done
All backports for this PR have been created
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
type/bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #14531.
Per #14531, deleting a user account will delete the user's GPG keys
from the
gpg_key
table but not fromgpg_key_import
, which causesan error when creating an account with the same email and attempting
to re-add the same key. This commit deletes all entries from
gpg_key_import
that match any GPG key IDs belonging to the user.Note: Deleting the user's keys from
gpg_key_import
this way seems pretty convoluted,but I don't see an obvious alternative except for maybe modifying
GPGKeyImport
tohave an
OwnerID
field as inGPGKey
.