Skip to content

Commit eae8d24

Browse files
Remove redundant default scopes (#5343) (#10374)
Signed-off-by: Modular Magician <[email protected]>
1 parent a00b159 commit eae8d24

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

.changelog/5343.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:breaking-change
2+
provider: removed redundant default scopes. The provider's default scopes when authenticating with credentials are now exclusively "https://www.googleapis.com/auth/cloud-platform" and "https://www.googleapis.com/auth/userinfo.email".
3+
```

google/config.go

-4
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,7 @@ var DefaultBasePaths = map[string]string{
341341
}
342342

343343
var DefaultClientScopes = []string{
344-
"https://www.googleapis.com/auth/compute",
345344
"https://www.googleapis.com/auth/cloud-platform",
346-
"https://www.googleapis.com/auth/cloud-identity",
347-
"https://www.googleapis.com/auth/ndev.clouddns.readwrite",
348-
"https://www.googleapis.com/auth/devstorage.full_control",
349345
"https://www.googleapis.com/auth/userinfo.email",
350346
}
351347

website/docs/guides/provider_reference.html.markdown

-3
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,7 @@ an access token using the service account key specified in `credentials`.
265265

266266
By default, the following scopes are configured:
267267

268-
* https://www.googleapis.com/auth/compute
269268
* https://www.googleapis.com/auth/cloud-platform
270-
* https://www.googleapis.com/auth/ndev.clouddns.readwrite
271-
* https://www.googleapis.com/auth/devstorage.full_control
272269
* https://www.googleapis.com/auth/userinfo.email
273270

274271
* `request_reason` - (Optional) Send a Request Reason [System Parameter](https://cloud.google.com/apis/docs/system-parameters) for each API call made by the provider. The `X-Goog-Request-Reason` header value is used to provide a user-supplied justification into GCP AuditLogs. Alternatively, this can be specified using the `CLOUDSDK_CORE_REQUEST_REASON` environment variable.

website/docs/guides/version_4_upgrade.html.markdown

+21
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ description: |-
1212
- [I accidentally upgraded to 4.0.0, how do I downgrade to `3.X`?](#i-accidentally-upgraded-to-400-how-do-i-downgrade-to-3x)
1313
- [Provider Version Configuration](#provider-version-configuration)
1414
- [Provider](#provider)
15+
- [Redundant default scopes are removed](#redundant-default-scopes-are-removed)
1516
- [Runtime Configurator (`runtimeconfig`) resources have been removed from the GA provider](#runtime-configurator-runtimeconfig-resources-have-been-removed-from-the-ga-provider)
1617
- [Datasource: `google_product_resource`](#datasource-google_product_resource)
1718
- [Datasource-level change example](#datasource-level-change-example)
@@ -154,6 +155,26 @@ terraform {
154155

155156
## Provider
156157

158+
### Redundant default scopes are removed
159+
160+
Several default scopes are removed from the provider:
161+
162+
* "https://www.googleapis.com/auth/compute"
163+
* "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
164+
* "https://www.googleapis.com/auth/devstorage.full_control"
165+
* "https://www.googleapis.com/auth/cloud-identity"
166+
167+
They are redundant with the "https://www.googleapis.com/auth/cloud-platform"
168+
scope per [Access scopes](https://cloud.google.com/compute/docs/access/service-accounts#accesscopesiam).
169+
After this change the following scopes are enabled, in line with `gcloud`'s
170+
[list of scopes](https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login):
171+
172+
* "https://www.googleapis.com/auth/cloud-platform"
173+
* "https://www.googleapis.com/auth/userinfo.email"
174+
175+
This change is believed to have no user impact. If you find that Terraform
176+
behaves incorrectly as a result of this change, please report a [bug](https://github.com/hashicorp/terraform-provider-google/issues/new?assignees=&labels=bug&template=bug.md).
177+
157178
### Runtime Configurator (`runtimeconfig`) resources have been removed from the GA provider
158179

159180
Earlier versions of the provider accidentally included the Runtime Configurator

0 commit comments

Comments
 (0)