aboutsummaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/oauth2/internal
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/oauth2/internal')
-rw-r--r--vendor/golang.org/x/oauth2/internal/doc.go6
-rw-r--r--vendor/golang.org/x/oauth2/internal/oauth2.go1
-rw-r--r--vendor/golang.org/x/oauth2/internal/token.go9
-rw-r--r--vendor/golang.org/x/oauth2/internal/transport.go1
4 files changed, 12 insertions, 5 deletions
diff --git a/vendor/golang.org/x/oauth2/internal/doc.go b/vendor/golang.org/x/oauth2/internal/doc.go
new file mode 100644
index 0000000..03265e8
--- /dev/null
+++ b/vendor/golang.org/x/oauth2/internal/doc.go
@@ -0,0 +1,6 @@
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package internal contains support packages for oauth2 package.
+package internal
diff --git a/vendor/golang.org/x/oauth2/internal/oauth2.go b/vendor/golang.org/x/oauth2/internal/oauth2.go
index e31541b..6978192 100644
--- a/vendor/golang.org/x/oauth2/internal/oauth2.go
+++ b/vendor/golang.org/x/oauth2/internal/oauth2.go
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Package internal contains support packages for oauth2 package.
package internal
import (
diff --git a/vendor/golang.org/x/oauth2/internal/token.go b/vendor/golang.org/x/oauth2/internal/token.go
index 018b58a..cf959ea 100644
--- a/vendor/golang.org/x/oauth2/internal/token.go
+++ b/vendor/golang.org/x/oauth2/internal/token.go
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Package internal contains support packages for oauth2 package.
package internal
import (
@@ -18,6 +17,7 @@ import (
"time"
"golang.org/x/net/context"
+ "golang.org/x/net/context/ctxhttp"
)
// Token represents the crendentials used to authorize
@@ -105,6 +105,7 @@ var brokenAuthHeaderProviders = []string{
"https://graph.facebook.com", // see https://github.com/golang/oauth2/issues/214
"https://login.microsoftonline.com/",
"https://login.salesforce.com/",
+ "https://login.windows.net",
"https://oauth.sandbox.trainingpeaks.com/",
"https://oauth.trainingpeaks.com/",
"https://oauth.vk.com/",
@@ -120,11 +121,13 @@ var brokenAuthHeaderProviders = []string{
"https://www.wunderlist.com/oauth/",
"https://api.patreon.com/",
"https://sandbox.codeswholesale.com/oauth/token",
+ "https://api.sipgate.com/v1/authorization/oauth",
}
// brokenAuthHeaderDomains lists broken providers that issue dynamic endpoints.
var brokenAuthHeaderDomains = []string{
".force.com",
+ ".myshopify.com",
".okta.com",
".oktapreview.com",
}
@@ -184,9 +187,9 @@ func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string,
}
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
if !bustedAuth {
- req.SetBasicAuth(clientID, clientSecret)
+ req.SetBasicAuth(url.QueryEscape(clientID), url.QueryEscape(clientSecret))
}
- r, err := hc.Do(req)
+ r, err := ctxhttp.Do(ctx, hc, req)
if err != nil {
return nil, err
}
diff --git a/vendor/golang.org/x/oauth2/internal/transport.go b/vendor/golang.org/x/oauth2/internal/transport.go
index f1f173e..783bd98 100644
--- a/vendor/golang.org/x/oauth2/internal/transport.go
+++ b/vendor/golang.org/x/oauth2/internal/transport.go
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Package internal contains support packages for oauth2 package.
package internal
import (