Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 959dc01

Browse files
authored
Merge pull request #1009 from smola/tokenauth-doc
http: improve TokenAuth documentation
2 parents 3033d45 + 8aab983 commit 959dc01

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

plumbing/transport/http/common.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,14 @@ func (a *BasicAuth) String() string {
214214
return fmt.Sprintf("%s - %s:%s", a.Name(), a.Username, masked)
215215
}
216216

217-
// TokenAuth implements the go-git http.AuthMethod and transport.AuthMethod interfaces
217+
// TokenAuth implements an http.AuthMethod that can be used with http transport
218+
// to authenticate with HTTP token authentication (also known as bearer
219+
// authentication).
220+
//
221+
// IMPORTANT: If you are looking to use OAuth tokens with popular servers (e.g.
222+
// GitHub, Bitbucket, GitLab) you should use BasicAuth instead. These servers
223+
// use basic HTTP authentication, with the OAuth token as user or password.
224+
// Check the documentation of your git server for details.
218225
type TokenAuth struct {
219226
Token string
220227
}

0 commit comments

Comments
 (0)