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

Restore user autoregistration with email addresses #19261

Merged
merged 6 commits into from
Mar 31, 2022

Conversation

zeripath
Copy link
Contributor

Unfortunately #18789 disabled autoregistration using email addresses as they would
be shortcut to email address does not exist.

This PR attempts to restore autoregistration by allowing an unknown email address
to percolate through to the autoregistration path of UserSignin.

Fix #19256

Signed-off-by: Andrew Thornton art27@cantab.net

Unfortunately go-gitea#18789 disabled autoregistration using email addresses as they would
be shortcut to email address does not exist.

This PR attempts to restore autoregistration by allowing an unknown email address
to percolate through to the autoregistration path of UserSignin.

Fix go-gitea#19256

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added type/bug backport/v1.1 issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself labels Mar 29, 2022
@zeripath zeripath added this to the 1.17.0 milestone Mar 29, 2022
services/auth/signin.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 30, 2022
@wxiaoguang
Copy link
Contributor

That's a lot of changes, I think if there is a chance, we should define the logic clearly and write some tests .....

@zeripath
Copy link
Contributor Author

That's a lot of changes

Hide whitespace and you'll see the change it's not actually that much.

But yes we do need some tests here. I think the fundamental issue is that we need to be able to mock up the authenticators but I think we can do that reasonably now.

@GiteaBot 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 Mar 30, 2022
@GiteaBot 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 Mar 31, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #19261 (4451d98) into main (43332a4) will increase coverage by 0.02%.
The diff coverage is 44.11%.

@@            Coverage Diff             @@
##             main   #19261      +/-   ##
==========================================
+ Coverage   47.50%   47.52%   +0.02%     
==========================================
  Files         931      931              
  Lines      130513   130520       +7     
==========================================
+ Hits        61998    62033      +35     
+ Misses      61043    61017      -26     
+ Partials     7472     7470       -2     
Impacted Files Coverage Δ
services/auth/signin.go 46.05% <44.11%> (+1.12%) ⬆️
modules/git/repo_base_nogogit.go 70.58% <0.00%> (-3.93%) ⬇️
modules/git/utils.go 66.29% <0.00%> (-3.38%) ⬇️
modules/queue/workerpool.go 53.26% <0.00%> (-0.53%) ⬇️
services/pull/pull.go 39.78% <0.00%> (-0.47%) ⬇️
models/issue_comment.go 51.52% <0.00%> (-0.46%) ⬇️
modules/queue/queue_bytefifo.go 50.18% <0.00%> (+0.36%) ⬆️
services/gitdiff/gitdiff.go 75.62% <0.00%> (+0.80%) ⬆️
models/notification.go 64.25% <0.00%> (+1.08%) ⬆️
... and 7 more

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 43332a4...4451d98. Read the comment docs.

@6543
Copy link
Member

6543 commented Mar 31, 2022

👋 🤖

@6543 6543 merged commit f6145a6 into go-gitea:main Mar 31, 2022
@lunny
Copy link
Member

lunny commented Mar 31, 2022

Please send backport

zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 1, 2022
* giteaoffical/main:
  Fix broken of team create (go-gitea#19288)
  Remove `git.Command.Run` and `git.Command.RunInDir*` (go-gitea#19280)
  Performance improvement for add team user when org has more than 1000 repositories (go-gitea#19227)
  [skip ci] Updated translations via Crowdin
  Update JS dependencies (go-gitea#19281)
  Fix container download counter (go-gitea#19287)
  go.mod: update kevinburke/ssh_config to v1.2.0 (go-gitea#19286)
  Fix global packages enabled avaiable (go-gitea#19276)
  Add Goroutine stack inspector to admin/monitor (go-gitea#19207)
  Move checks for pulls before merge into own function (go-gitea#19271)
  Restore user autoregistration with email addresses (go-gitea#19261)
  Improve sync performance for pull-mirrors (go-gitea#19125)
  Refactor `git.Command.Run*`, introduce `RunWithContextString` and `RunWithContextBytes` (go-gitea#19266)
  Move reaction to models/issues/ (go-gitea#19264)
@zeripath zeripath deleted the fix-19256-handle-email-autoregistration branch April 2, 2022 10:24
zeripath added a commit to zeripath/gitea that referenced this pull request Apr 2, 2022
Backport go-gitea#19261

Unfortunately go-gitea#18789 disabled autoregistration using email addresses as they would
be shortcut to email address does not exist.

This PR attempts to restore autoregistration by allowing an unknown email address
to percolate through to the autoregistration path of UserSignin.

Fix go-gitea#19256

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added the backport/done All backports for this PR have been created label Apr 2, 2022
techknowlogick pushed a commit that referenced this pull request Apr 3, 2022
Backport #19261

Unfortunately #18789 disabled autoregistration using email addresses as they would
be shortcut to email address does not exist.

This PR attempts to restore autoregistration by allowing an unknown email address
to percolate through to the autoregistration path of UserSignin.

Fix #19256

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
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 issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SMTP Auto Registration Broken after v1.15.11
7 participants