-
-
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
Make captcha and password optional for external accounts #6606
Make captcha and password optional for external accounts #6606
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6606 +/- ##
==========================================
- Coverage 41.24% 41.22% -0.03%
==========================================
Files 467 467
Lines 63336 63360 +24
==========================================
- Hits 26124 26121 -3
- Misses 33796 33823 +27
Partials 3416 3416
Continue to review full report at Codecov.
|
…AL_REGISTRATION_PASSWORD
agreed Co-Authored-By: solderjs <coolaj86@gmail.com>
046312a
to
fca8843
Compare
Updated and rebased. |
routers/user/auth.go
Outdated
@@ -116,6 +118,7 @@ func SignIn(ctx *context.Context) { | |||
return | |||
} | |||
|
|||
ctx.Data["AllowPassword"] = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this always true
? Shouldn't this depend on the setting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the sign-up with password page. It doesn't make sense to get to that page unless it's true.
routers/user/auth.go
Outdated
ctx.Data["Title"] = ctx.Tr("link_account") | ||
ctx.Data["LinkAccountMode"] = true | ||
ctx.Data["EnableCaptcha"] = setting.Service.EnableCaptcha | ||
ctx.Data["EnableCaptcha"] = setting.Service.RequireExternalRegistrationCaptcha |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also make this dependend on setting.Service.EnableCaptcha
(either setting.Service.EnableCaptcha
should be true, or setting.Service.EnableCaptcha
and setting.Service.RequireExternalRegistrationCaptcha
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay.
routers/user/auth.go
Outdated
ctx.Data["Title"] = ctx.Tr("link_account") | ||
ctx.Data["LinkAccountMode"] = true | ||
ctx.Data["LinkAccountModeSignIn"] = true | ||
ctx.Data["EnableCaptcha"] = setting.Service.EnableCaptcha | ||
ctx.Data["EnableCaptcha"] = setting.Service.RequireExternalRegistrationCaptcha |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
routers/user/auth.go
Outdated
ctx.Data["Title"] = ctx.Tr("link_account") | ||
ctx.Data["LinkAccountMode"] = true | ||
ctx.Data["LinkAccountModeRegister"] = true | ||
ctx.Data["EnableCaptcha"] = setting.Service.EnableCaptcha | ||
ctx.Data["EnableCaptcha"] = setting.Service.RequireExternalRegistrationCaptcha |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
@solderjs are you planing to continue work on this? |
I think Actually, flipping it around to |
OK I've taken the liberty of updating and addressing @kolaente's concerns |
I've also removed the random password as an empty password is just as good. |
@lafriks need your approval. |
Is there anything else that this needs presently? It's a holiday today so I have some free cycles. |
This is not particularly true. It is very likely that a programmer will make a mistake (whether already in the past, or in the future), in which a comparison is made between some API or Form input and the password, not checking to see if the password is blank. It is very, very unlikely that the programmer will accidentally check the password against a pre-computed random string. |
My commits have been aimed at providing authentication patterns that are both more secure and easier to use than the default password authentication. My hope is that one day passwords will be disabled by default and you will have to specifically opt-in to using a password with some sort of "warning: you're opening up your gitea instance and all of your users to pwnage". Hence That said, call it what you will. |
Hi @solderjs I understand what you're saying about comparing empty passwords to empty strings - but we've already had to deal with this problem and have already fixed it. So whilst your concern would be correct - we've got the fix in. Now because of our logic - if the password is empty we can assume that the password is not set. Thus we can migrate to remove the local password in future easily - because an empty password is an unset one. Yes, I agree this is not ideal and I would prefer to do this properly - however we cannot do that at this point in 1.9. If you stick a random password in - I won't be able to do that migration in future. Removing the special status of the local db password is on my personal list of things to do, but my list is long. The technical debt of Gogs is very large IMHO. Now, regarding I do appreciate what you're aiming for though. |
👍 |
Replaces https://github.com/go-gitea/gitea/pull/5029/files
REQUIRE_EXTERNAL_REGISTRATION_CAPTCHA
REQUIRE_EXTERNAL_REGISTRATION_PASSWORD
This is part of the group of work for collective UX improvement and account security related to passwords and secondary accounts.