diff options
author | Michael Muré <batolettre@gmail.com> | 2019-12-08 21:15:06 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-12-08 21:28:27 +0100 |
commit | b92adfcb5f79f2b32c3dafb0fc3e7f1b753b6197 (patch) | |
tree | 69202c4021b10f3ab7b7f5ebf229d501e95c4786 /bridge/github/github.go | |
parent | 981a4a848b1329da1a73270e27633911f9298bb1 (diff) | |
download | git-bug-b92adfcb5f79f2b32c3dafb0fc3e7f1b753b6197.tar.gz |
bridge: huge refactor to accept multiple kind of credentials
Diffstat (limited to 'bridge/github/github.go')
-rw-r--r-- | bridge/github/github.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bridge/github/github.go b/bridge/github/github.go index e4fb03dd..874c2d11 100644 --- a/bridge/github/github.go +++ b/bridge/github/github.go @@ -8,6 +8,7 @@ import ( "golang.org/x/oauth2" "github.com/MichaelMure/git-bug/bridge/core" + "github.com/MichaelMure/git-bug/bridge/core/auth" ) type Github struct{} @@ -24,9 +25,9 @@ func (*Github) NewExporter() core.Exporter { return &githubExporter{} } -func buildClient(token string) *githubv4.Client { +func buildClient(token *auth.Token) *githubv4.Client { src := oauth2.StaticTokenSource( - &oauth2.Token{AccessToken: token}, + &oauth2.Token{AccessToken: token.Value}, ) httpClient := oauth2.NewClient(context.TODO(), src) |