-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azkv: update SDK to latest, add tests, tidy #1067
Merged
Merged
Conversation
This file contains 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
hiddeco
changed the title
azkv: update to latest client, add tests, tidy
azkv: update SDK to latest, add tests, tidy
May 30, 2022
ajvb
reviewed
May 31, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just need to update the README and we'll be ready to merge.
ajvb
reviewed
May 31, 2022
This is required for the latest Azure SDK, and comes with general improvements for certain CPU types. Includes a change of `%w` -> `%v` for `t.Errorf` due to dropped support for wrapping. Signed-off-by: Hidde Beydals <hello@hidde.co>
This updates the Azure SDK to latest[1], while dropping the custom authentication flow in favor of the SDK default[2]. It includes integration tests, which require the `integration` Go build tag and a set of environmental variables to be configured to be run: ``` PASS coverage: 81.2% of statements ok go.mozilla.org/sops/v3/azkv 5.376s coverage: 81.2% of statements ``` The improvements are based on a fork of the key source in the Flux project's kustomize-controller, built due to SOPS' limitation around credential managment without relying on runtime environment variables. - Azure SDK has been updated to latest, including integration test coverage. - Custom authentication flow has been dropped in favor of the SDK default[2]. This should work well on almost any system and is generally the go-to way of setting this up, including on cloud environments, etc. - It introduces a `TokenCredential` type which holds an `azcore.TokenCredential`, and can be applied to a `MasterKey`. When applied, the token is used instead of the SDK default. This is most useful when working with SOPS as an SDK, in combination with e.g. a local key service server implementation. - Extensive test coverage. The forked version of this has compatibility tests to ensure it works with current SOPS: - https://github.com/fluxcd/kustomize-controller/blob/327a3560b35c5994647938958aa5523f319094b8/internal/sops/azkv/keysource_integration_test.go#L89 - https://github.com/fluxcd/kustomize-controller/blob/327a3560b35c5994647938958aa5523f319094b8/internal/sops/azkv/keysource_integration_test.go#L117 [1]: https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/keyvault/azkeys [2]: https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential Signed-off-by: Hidde Beydals <hello@hidde.co>
Plus update mention of Go version requirement. Signed-off-by: Hidde Beydals <hello@hidde.co>
ajvb
approved these changes
Jun 6, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
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 updates the Azure SDK to latest, while dropping the custom
authentication flow in favor of the SDK default. It includes
integration tests, which require the
integration
Go build tag anda set of environmental variables to be configured to be run:
The improvements are based on a fork of the key source in the Flux
project's kustomize-controller, built due to SOPS' limitation around
credential managment without relying on runtime environment variables.
coverage.
default. This should work well on almost any system and is
generally the go-to way of setting this up, including on cloud
environments, etc.
TokenCredential
type which holds anazcore.TokenCredential
, and can be applied to aMasterKey
.When applied, the token is used instead of the SDK default. This is
most useful when working with SOPS as an SDK, in combination with
e.g. a local key service server implementation.
The forked version of this has compatibility tests to ensure it works
with current SOPS: