From c3f4d6910e6ada55b8df214142d0aaab53d954c1 Mon Sep 17 00:00:00 2001 From: salrashid123 Date: Wed, 25 Aug 2021 22:26:44 -0400 Subject: [PATCH] remove lifetime restrict --- impersonate/impersonate.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/impersonate/impersonate.go b/impersonate/impersonate.go index 7af0f119f..a423d1c25 100644 --- a/impersonate/impersonate.go +++ b/impersonate/impersonate.go @@ -8,10 +8,6 @@ import ( "context" "encoding/json" "fmt" - "golang.org/x/oauth2" - "golang.org/x/oauth2/google" - "golang.org/x/oauth2/jws" - "google.golang.org/api/iamcredentials/v1" "io" "io/ioutil" "net/http" @@ -19,6 +15,11 @@ import ( "strings" "sync" "time" + + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + "golang.org/x/oauth2/jws" + "google.golang.org/api/iamcredentials/v1" ) // ImpersonatedTokenConfig prameters to start Credential impersonation exchange. @@ -72,9 +73,6 @@ func ImpersonatedTokenSource(tokenConfig *ImpersonatedTokenConfig) (oauth2.Token if tokenConfig.RootTokenSource == nil { return nil, fmt.Errorf("oauth2/google: rootSource cannot be nil") } - if tokenConfig.Lifetime > (3600 * time.Second) { - return nil, fmt.Errorf("oauth2/google: lifetime must be less than or equal to 3600 seconds") - } return &impersonatedTokenSource{ refreshMutex: &sync.Mutex{}, // guards impersonatedToken; held while fetching or updating it.