mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-23 02:11:01 +00:00
Merge pull request #2241 from tboerger/fix-gitea
Urgent fix for changed auth behavior on Gitea
This commit is contained in:
commit
578e8847cf
2 changed files with 4 additions and 4 deletions
|
@ -271,8 +271,8 @@ func (c *client) Netrc(u *model.User, r *model.Repo) (*model.Netrc, error) {
|
|||
}, nil
|
||||
}
|
||||
return &model.Netrc{
|
||||
Login: u.Token,
|
||||
Password: "x-oauth-basic",
|
||||
Login: u.Login,
|
||||
Password: u.Token,
|
||||
Machine: c.Machine,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
@ -55,8 +55,8 @@ func Test_gitea(t *testing.T) {
|
|||
})
|
||||
netrc, _ := remote.Netrc(fakeUser, nil)
|
||||
g.Assert(netrc.Machine).Equal("gitea.com")
|
||||
g.Assert(netrc.Login).Equal(fakeUser.Token)
|
||||
g.Assert(netrc.Password).Equal("x-oauth-basic")
|
||||
g.Assert(netrc.Login).Equal(fakeUser.Login)
|
||||
g.Assert(netrc.Password).Equal(fakeUser.Token)
|
||||
})
|
||||
g.It("Should return a netrc with the machine account", func() {
|
||||
remote, _ := New(Opts{
|
||||
|
|
Loading…
Reference in a new issue