Skip to content

Commit

Permalink
better logging msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
emilymye committed Jan 10, 2019
1 parent 2063451 commit 8bc7baf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions third_party/terraform/utils/config.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func (c *Config) getTokenSource(clientScopes []string) (oauth2.TokenSource, erro
return nil, fmt.Errorf("Error loading access token: %s", err)
}

log.Printf("[INFO] Using configured Google access token (length %d)", len(contents))
log.Printf("[INFO] Authenticating using configured Google JSON 'access_token'...")
log.Printf("[INFO] -- Scopes: %s", clientScopes)
token := &oauth2.Token{AccessToken: contents}
return oauth2.StaticTokenSource(token), nil
Expand All @@ -402,12 +402,12 @@ func (c *Config) getTokenSource(clientScopes []string) (oauth2.TokenSource, erro
return nil, fmt.Errorf("Unable to parse credentials from '%s': %s", contents, err)
}

log.Printf("[INFO] Requesting Google token using Credential File %q...", c.Credentials)
log.Printf("[INFO] Authenticating using configured Google JSON 'credentials'...")
log.Printf("[INFO] -- Scopes: %s", clientScopes)
return creds.TokenSource, nil
}

log.Printf("[INFO] Authenticating using DefaultClient")
log.Printf("[INFO] Authenticating using DefaultClient...")
log.Printf("[INFO] -- Scopes: %s", clientScopes)
return googleoauth.DefaultTokenSource(context.Background(), clientScopes...)
}

0 comments on commit 8bc7baf

Please sign in to comment.