mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 10:03:42 +08:00 
			
		
		
		
	Bump buildkit to master and fix versions incompatible with go mod 1.13
Bump github.com/gogo/googleapis to v1.3.2 Bump github.com/docker/cli to master Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
		
							
								
								
									
										9
									
								
								vendor/golang.org/x/oauth2/token.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								vendor/golang.org/x/oauth2/token.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -5,6 +5,7 @@
 | 
			
		||||
package oauth2
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"context"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/url"
 | 
			
		||||
@@ -12,7 +13,6 @@ import (
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"golang.org/x/net/context"
 | 
			
		||||
	"golang.org/x/oauth2/internal"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@@ -118,13 +118,16 @@ func (t *Token) Extra(key string) interface{} {
 | 
			
		||||
	return v
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// timeNow is time.Now but pulled out as a variable for tests.
 | 
			
		||||
var timeNow = time.Now
 | 
			
		||||
 | 
			
		||||
// expired reports whether the token is expired.
 | 
			
		||||
// t must be non-nil.
 | 
			
		||||
func (t *Token) expired() bool {
 | 
			
		||||
	if t.Expiry.IsZero() {
 | 
			
		||||
		return false
 | 
			
		||||
	}
 | 
			
		||||
	return t.Expiry.Round(0).Add(-expiryDelta).Before(time.Now())
 | 
			
		||||
	return t.Expiry.Round(0).Add(-expiryDelta).Before(timeNow())
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Valid reports whether t is non-nil, has an AccessToken, and is not expired.
 | 
			
		||||
@@ -151,7 +154,7 @@ func tokenFromInternal(t *internal.Token) *Token {
 | 
			
		||||
// This token is then mapped from *internal.Token into an *oauth2.Token which is returned along
 | 
			
		||||
// with an error..
 | 
			
		||||
func retrieveToken(ctx context.Context, c *Config, v url.Values) (*Token, error) {
 | 
			
		||||
	tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v)
 | 
			
		||||
	tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v, internal.AuthStyle(c.Endpoint.AuthStyle))
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		if rErr, ok := err.(*internal.RetrieveError); ok {
 | 
			
		||||
			return nil, (*RetrieveError)(rErr)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user