fix(secretstores.googlecloud): Handle public GCP service account keys correctly#18785
fix(secretstores.googlecloud): Handle public GCP service account keys correctly#18785crflanigan wants to merge 7 commits intoinfluxdata:masterfrom
Conversation
…standard service-account JSON keys
When using a normal GCP service-account key (the JSON downloaded from
the Cloud Console, type: "service_account") with the new secret store
+ token = "@{id:token}" pattern in outputs.stackdriver, the Google auth
library previously received an unscoped token that was rejected by the
Monitoring API.
This change adds a tiny guarded default in Init():
- If credType == "service_account" and no scopes are explicitly set,
automatically use ["https://www.googleapis.com/auth/monitoring"].
The existing GDCH/STS flow (via sts_audience) is completely untouched.
The new `scopes` config option is also available for users who need a
different set (e.g. cloud-platform).
No changes to stackdriver.go or any other plugin — keeps the PR as
small and low-risk as possible
…bedded scopes struct value
srebhan
left a comment
There was a problem hiding this comment.
Thanks a lot @crflanigan! Just a small comment... Please run make docs before pushing. :-)
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
|
@srebhan, I committed your suggestion :) As for the make docs, do I need to do that now, or with this committed suggestion (thanks!) are we good to go? |
|
@crflanigan you need to do it now and push the changes as CI checks if the README "configuration" section matches the |
|
Alright, all done @srebhan! |
|
The auto-default to Two cleaner options:
Whichever you pick, please update the sample.conf wording to match - right now the comment says |
Co-authored-by: skartikey <s.kartikey@gmail.com>
Co-authored-by: skartikey <s.kartikey@gmail.com>
skartikey
left a comment
There was a problem hiding this comment.
@crflanigan A couple of comments.
CI: gofmt failure on the new field line is what's failing lint-linux/macos/windows. make fmt will fix it.
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
|
All set @skartikey @srebhan Thanks for the feedback! |
Summary
When using a normal GCP service-account key (the JSON downloaded from the Cloud Console, type: "service_account") with the new secret store
This change adds a tiny guarded default in Init():
The existing GDCH/STS flow (via sts_audience) is completely untouched. The new
credential_scopesconfig option is also available for users who need a different set (e.g. cloud-platform).No changes to stackdriver.go or any other plugin — keeps the PR as small and low-risk as possible
Checklist
Related issues
resolves #16326