Skip to content

Commit e0a3e4a

Browse files
Make defaultClientScopes publicly accessible (#3785) (#2308)
This patch makes the `defaultClientScopes` variable publicly accessible to allow for code that depends on the provider to have the ability to programmatically determine the default OAuth2 scopes used by the provider, and to add to it if necessary. Signed-off-by: Modular Magician <[email protected]>
1 parent 976b4ba commit e0a3e4a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.changelog/3785.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google-beta/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ var StorageDefaultBasePath = "https://www.googleapis.com/storage/v1/"
298298
var TPUDefaultBasePath = "https://tpu.googleapis.com/v1/"
299299
var VPCAccessDefaultBasePath = "https://vpcaccess.googleapis.com/v1/"
300300

301-
var defaultClientScopes = []string{
301+
var DefaultClientScopes = []string{
302302
"https://www.googleapis.com/auth/compute",
303303
"https://www.googleapis.com/auth/cloud-platform",
304304
"https://www.googleapis.com/auth/cloud-identity",
@@ -309,7 +309,7 @@ var defaultClientScopes = []string{
309309

310310
func (c *Config) LoadAndValidate(ctx context.Context) error {
311311
if len(c.Scopes) == 0 {
312-
c.Scopes = defaultClientScopes
312+
c.Scopes = DefaultClientScopes
313313
}
314314

315315
tokenSource, err := c.getTokenSource(c.Scopes)

0 commit comments

Comments
 (0)