-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
fix .netrc authentication #2700
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2700 +/- ##
======================================
Coverage 27.1% 27.1%
======================================
Files 87 87
Lines 17191 17191
======================================
Hits 4659 4659
Misses 11852 11852
Partials 680 680 Continue to review full report at Codecov.
|
@daviian but since harness/harness#2241 merged. This PR will broke it again? |
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.
Yes I think that would break fixed drone
And current drone only works with latest gitea release... and that's not good at all. Every gitea user that uses drone is now forced to upgrade |
Drone support only 1.2 anyway as only 1.2 has status api |
But as you can see in issues users use drone in 1.1.4 and earlier as well. |
Signed-off-by: David Schneiderbauer <[email protected]>
391f941
to
bed668c
Compare
Signed-off-by: David Schneiderbauer <[email protected]>
@daviian gitea 1.1.4 could use Gogs driver of drone. |
@daviian I still think it's not a good idea to do this as .netrc anyway supports both username&password and drone is only that use this and now that it has already changed to use new way, let's than keep just one way not to have problems later. |
@lafriks but that ask people upgrade their drone to latest. So I will give this LGTM |
LGTM |
routers/repo/http.go
Outdated
if err != nil { | ||
ctx.Handle(http.StatusInternalServerError, "GetUserByID", err) | ||
} | ||
} else { |
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.
else if
routers/repo/http.go
Outdated
if isUsernameToken { | ||
authUser, err = models.GetUserByID(token.UID) | ||
if err != nil { | ||
ctx.Handle(http.StatusInternalServerError, "GetUserByID", err) |
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.
missing return
?
routers/repo/http.go
Outdated
if isUsernameToken { | ||
// Assume username is token | ||
authToken = authUsername | ||
} else { |
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.
// Assume username is token
authToken := authUsername
if !isUsernameToken {
// Assume password is token
authToken = authPasswd
Signed-off-by: David Schneiderbauer <[email protected]>
Make LG-TM work |
Make it work again |
@daviian please backport to 1.2 branch |
* provide both possible authentication solutions Signed-off-by: David Schneiderbauer <[email protected]>
* provide both possible authentication solutions Signed-off-by: David Schneiderbauer <[email protected]>
Fixes #2480
Reverted a part of #2184 to allow token usage without the need of 2FA.
But token is required if 2FA is enabled!