1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-11-29 21:48:14 +02:00

Support github refresh tokens (#3811)

This commit is contained in:
Anbraten
2024-11-22 19:12:43 +01:00
committed by GitHub
parent bd349c8eaf
commit 53d6421940
24 changed files with 231 additions and 199 deletions

View File

@@ -65,7 +65,7 @@ func Test_github(t *testing.T) {
forge, _ := New(Opts{})
netrc, _ := forge.Netrc(fakeUser, fakeRepo)
g.Assert(netrc.Machine).Equal("github.com")
g.Assert(netrc.Login).Equal(fakeUser.Token)
g.Assert(netrc.Login).Equal(fakeUser.AccessToken)
g.Assert(netrc.Password).Equal("x-oauth-basic")
})
g.It("Should return a netrc with the machine account", func() {
@@ -115,8 +115,8 @@ func Test_github(t *testing.T) {
var (
fakeUser = &model.User{
Login: "octocat",
Token: "cfcd2084",
Login: "octocat",
AccessToken: "cfcd2084",
}
fakeRepo = &model.Repo{