Skip to content

Commit

Permalink
remove lifetime restrict
Browse files Browse the repository at this point in the history
  • Loading branch information
salrashid123 committed Aug 26, 2021
1 parent ca6b525 commit c3f4d69
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions impersonate/impersonate.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ 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"
"net/url"
"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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit c3f4d69

Please sign in to comment.