Conversation
…ls also from Vault sourced GCP service account keys
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds support for exchanging Vault-sourced credentials (Azure client secrets and GCP service account keys) for access tokens. The PR introduces new Azure and GCP access token providers within the Vault package that handle the token exchange and automatic refresh, along with configuration options to enable this behavior.
Changes:
- Added new Azure and GCP access token providers that exchange Vault-sourced credentials for cloud provider access tokens with automatic refresh
- Refactored the Vault credentials refresh loop to support worker goroutines for credential exchange
- Introduced util.SendErrorToChannel helper function to simplify error handling across all credential providers
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/vault/option.go | Added configuration options for enabling GCP service account key exchange and Azure client secret exchange with customizable scopes and tenant ID |
| pkg/vault/gcp.go | New file implementing GCP access token provider that exchanges service account keys for access tokens with retry logic and automatic refresh |
| pkg/vault/azure.go | New file implementing Azure access token provider that exchanges client credentials for access tokens with automatic refresh |
| pkg/vault/creds.go | Refactored credential refresh loop to support worker goroutines, added authentication helper, and integrated new access token providers |
| pkg/util/credential.go | Added SendErrorToChannel helper function to standardize error result creation and sending |
| pkg/oci/creds.go | Updated to use new SendErrorToChannel helper for consistency |
| pkg/oauth2cc/oauth2cc.go | Updated to use new SendErrorToChannel helper for consistency |
| pkg/generic/creds.go | Updated to use new SendErrorToChannel helper for consistency |
| pkg/gcp/creds.go | Updated to use new SendErrorToChannel helper for consistency |
| pkg/azure/creds.go | Updated to use new SendErrorToChannel helper for consistency and moved expiry check before sending credentials |
| pkg/aws/creds.go | Updated to use new SendErrorToChannel helper for consistency |
| go.mod | Added cenkalti/backoff/v5 dependency and promoted go-viper/mapstructure/v2 to direct dependency |
| go.sum | Updated checksums for new and modified dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new Azure access token provider for Vault, and GCP access token provider for service account keys sourced from Vault.