aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2018-10-31 10:46:26 +0100
committerGitHub <noreply@github.com>2018-10-31 10:46:26 +0100
commit959dc01faa3352c0b41ff0fa257239f5f00165db (patch)
tree0c22811d3e8ea2a80636753149088d7ed0f90c40 /plumbing/transport
parent3033d45502aa2d7b99d94873b2fa7fd98e66936b (diff)
parent8aab983ab6acccab729f164f238bcdf318cc03bb (diff)
downloadgo-git-959dc01faa3352c0b41ff0fa257239f5f00165db.tar.gz
Merge pull request #1009 from smola/tokenauth-doc
http: improve TokenAuth documentation
Diffstat (limited to 'plumbing/transport')
-rw-r--r--plumbing/transport/http/common.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/plumbing/transport/http/common.go b/plumbing/transport/http/common.go
index 2909a06..5d3535e 100644
--- a/plumbing/transport/http/common.go
+++ b/plumbing/transport/http/common.go
@@ -214,7 +214,14 @@ func (a *BasicAuth) String() string {
return fmt.Sprintf("%s - %s:%s", a.Name(), a.Username, masked)
}
-// TokenAuth implements the go-git http.AuthMethod and transport.AuthMethod interfaces
+// TokenAuth implements an http.AuthMethod that can be used with http transport
+// to authenticate with HTTP token authentication (also known as bearer
+// authentication).
+//
+// IMPORTANT: If you are looking to use OAuth tokens with popular servers (e.g.
+// GitHub, Bitbucket, GitLab) you should use BasicAuth instead. These servers
+// use basic HTTP authentication, with the OAuth token as user or password.
+// Check the documentation of your git server for details.
type TokenAuth struct {
Token string
}