8000 Manually approve new registration · Pull Request #13083 · go-gitea/gitea · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Manually approve new registration #13083

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

Merged
merged 4 commits into from Dec 20, 2020
Merged

Manually approve new registration #13083

merged 4 commits into from Dec 20, 2020

Conversation

ghost
Copy link
@ghost ghost commented Oct 9, 2020

Add manual confirmation of the newly registered users.

This change speeds up the process of adding new confirmed users for Gitea instances without an external auth mechanism. (Currently, the option is to manually create a new user by admin.)

As this is a small change, I haven't created an issue. However, I am ready to do that if it is desired.

I am sure that the PR is not perfect and looking forward to the comments. Thanks!

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 9, 2020
@lafriks lafriks added the type/enhancement An improvement of existing functionality label Oct 9, 2020
@lafriks lafriks added this to the 1.14.0 milestone Oct 9, 2020
@codecov-io
Copy link
codecov-io commented Oct 9, 2020

Codecov Report

Merging #13083 (137de50) into master (36bd5d7) will increase coverage by 0.00%.
The diff coverage is 50.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #13083   +/-   ##
=======================================
  Coverage   42.32%   42.32%           
=======================================
  Files         726      726           
  Lines       77679    77683    +4     
=======================================
+ Hits        32876    32878    +2     
- Misses      39405    39408    +3     
+ Partials     5398     5397    -1     
Impacted Files Coverage Δ
modules/setting/service.go 81.81% <50.00%> (-2.50%) ⬇️
routers/user/auth.go 12.04% <50.00%> (ø)
models/unit.go 46.57% <0.00%> (-2.74%) ⬇️
modules/queue/unique_queue_disk_channel.go 53.84% <0.00%> (-1.54%) ⬇️
routers/repo/view.go 37.47% <0.00%> (-0.65%) ⬇️
services/pull/pull.go 41.37% <0.00%> (ø)
services/pull/check.go 50.36% <0.00%> (+0.72%) ⬆️
modules/process/manager.go 75.00% <0.00%> (+2.50%) ⬆️
modules/charset/charset.go 73.03% <0.00%> (+4.49%) ⬆️

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 36bd5d7...137de50. Read the comment docs.

@ghost ghost requested a review from lafriks October 9, 2020 13:54
@lafriks
Copy link
Member
lafriks commented Oct 10, 2020

But if you confirm by email user will still be activated so it will not be functional with both enabled

@ghost
Copy link
Author
ghost commented Oct 10, 2020

That's true. It would be possible to choose (exclusively) between confirming automatically, by email, or manually. (Is that problem?)

I think that enabling more than one way of confirmation would need database change but maybe I am wrong?

@lafriks
Copy link
Member
lafriks commented Oct 10, 2020

Yeah it would but than you should add a note for this in docs and example ini that this feature is supported only when REGISTER_EMAIL_CONFIRM is disabled.

@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 Oct 14, 2020
@lunny
Copy link
Member
lunny commented Oct 15, 2020

I think we have to rethink this more. Email confirmation will let you know the emails are addressable but manually confimation will not. I think we have more codes need to be changed on those aspect.

@ghost
Copy link
Author
ghost commented Oct 15, 2020

I think we have to rethink this more. Email confirmation will let you know the emails are addressable but manually confimation will not. I think we have more codes need to be changed on those aspect.

That's true, @lunny. However, this PR is for a particular use-case: We are a small team at university and we need to let students and cooperating partners join our development. We have some open source project, some of them are closed. We don't even need to track email addresses.

The point is that if we want to control access to the gitea instance, we can currently use external authentication (we don't have,) or manually create users. This simple PR will improve our workflow by just approving new users. Backward compatibility is preserved.

@lunny
Copy link
Member
lunny commented Oct 15, 2020

@qeef I know. I don't against the PR. I mean, if we can mark these email addresses as non-confirmed so that the future PRs could send a confirmation email to know if the notification emails could be received.

@ghost
Copy link
Author
ghost commented Oct 15, 2020

@lunny Marking emails as non-confirmed is one option, IMO. It would require a new column in the database.

The second option that comes into my mind is adding two new columns needs_confirm and is_confirm which would work as flags. In gitea configuration, you set needs_confirm flags, like email approved, manual approved, or anything else. When a particular approvement is done, you update is_confirm flags. And finally, when needs_confirm == is_confirm, you set is_active to true. However, changes in database and gui are inevitable and I am not sure about profitability.

Did you have a particular idea?

@ghost
Copy link
Author
ghost commented Oct 20, 2020

I was yet thinking about future PRs as mentioned above. I tend to say that email confirmation is a little bit of different functionality.

Currently, is_active does not mean the notification emails could be received anyway. Moreover, this PR does not limit future PRs, in my opinion.

Therefore, I propose to discuss emal confirmation in different issue/PR.

@zeripath
Copy link
Contributor

Hi @qeef,

is_active and is_confirmed would be essentially the same.

is_active exists to prevent users from pretending to be someone else and prevent that person from logging in.

I'm don't quite understand how this is supposed to work.

How are the users registering? what are they doing?

@lafriks
Copy link
Member
lafriks commented Oct 22, 2020

@zeripath for this PR use case is that if server does not have mail sending set up and user registers it is automatically activated but @qeef wants that users registers but admin than activates it manually

@zeripath
Copy link
Contributor

can't they just use the dummy mailer?

@ghost
Copy link
Author
ghost commented Oct 22, 2020

Hi @zeripath.

is_active exists to prevent users from pretending to be someone else and prevent that person from logging in.

it means that is_active is used for authentication.

I'm don't quite understand how this is supposed to work.

This PR use is_active column for authorization when no authentication over email is required. The backward compatibility is ensured.

The use-case is the manual control of the access to the Gitea instance (without necessity of external authentication configuration.) Currently, the manual access control can be done by creating users by admins. This PR let users create their accounts themselves, and let administrators just approve it (therefore speeds up the process.)

@ghost
Copy link
Author
ghost commented Nov 30, 2020

Guys, is there anything more I can do?

@ghost
Copy link
Author
ghost commented Dec 3, 2020

I fixed the last review and rebased to the current master.

Jiri Vlasak and others added 3 commits December 7, 2020 14:57
The new settings option is used when manually approving new
registrations.
When manual registration confirmation is desired (by default `false`)
create new user in the database that is *not active*. The user must then
be activated manually.

This change speeds up the process of adding new confirmed users for
Gitea instances without external auth mechanism. (Currently the option
is to manually create new user by admin.)
Co-authored-by: a1012112796 <1012112796@qq.com>
@GiteaBot GiteaBot removed the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Dec 20, 2020
@GiteaBot GiteaBot added the lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. label Dec 20, 2020
@techknowlogick techknowlogick merged commit d7c67a9 into go-gitea:master Dec 20, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Feb 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants
0