Update dependencies
Among others, this updates minio-go, so that the new "eu-west-3" zone for AWS is supported.
This commit is contained in:
parent
b63de7c798
commit
2b39f9f4b2
3435 changed files with 1318042 additions and 315692 deletions
16
vendor/golang.org/x/oauth2/internal/token_test.go
generated
vendored
16
vendor/golang.org/x/oauth2/internal/token_test.go
generated
vendored
|
@ -6,6 +6,7 @@ package internal
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
|
@ -32,6 +33,8 @@ func TestRetrieveTokenBustedNoSecret(t *testing.T) {
|
|||
if got, want := r.FormValue("client_secret"), ""; got != want {
|
||||
t.Errorf("client_secret = %q; want empty", got)
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
io.WriteString(w, `{"access_token": "ACCESS_TOKEN", "token_type": "bearer"}`)
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
|
@ -82,7 +85,10 @@ func TestProviderAuthHeaderWorksDomain(t *testing.T) {
|
|||
func TestRetrieveTokenWithContexts(t *testing.T) {
|
||||
const clientID = "client-id"
|
||||
|
||||
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}))
|
||||
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
io.WriteString(w, `{"access_token": "ACCESS_TOKEN", "token_type": "bearer"}`)
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
_, err := RetrieveToken(context.Background(), clientID, "", ts.URL, url.Values{})
|
||||
|
@ -90,14 +96,16 @@ func TestRetrieveTokenWithContexts(t *testing.T) {
|
|||
t.Errorf("RetrieveToken (with background context) = %v; want no error", err)
|
||||
}
|
||||
|
||||
ctx, cancelfunc := context.WithCancel(context.Background())
|
||||
|
||||
retrieved := make(chan struct{})
|
||||
cancellingts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
cancelfunc()
|
||||
<-retrieved
|
||||
}))
|
||||
defer cancellingts.Close()
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel()
|
||||
_, err = RetrieveToken(ctx, clientID, "", cancellingts.URL, url.Values{})
|
||||
close(retrieved)
|
||||
if err == nil {
|
||||
t.Errorf("RetrieveToken (with cancelled context) = nil; want error")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue