Skip to content
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 Azure SDK to v0.10.0 #1092

Merged
merged 5 commits into from
Jul 4, 2023
Merged

azkv: update Azure SDK to v0.10.0 #1092

merged 5 commits into from
Jul 4, 2023

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Jul 13, 2022

This depends on #1091 being merged into develop first, as I took the go.mod file state from there as a base.

Other than that, this PR does nothing more than dealing with the method (signature) and client construction changes from the v0.6.0 release of the azkeys module. This should be the last major change in their SDK.

I manually ran the integration test suite which passes without any issues:

$ go test -json -tags integration ./...
=== RUN   TestMasterKey_Encrypt
--- PASS: TestMasterKey_Encrypt (1.66s)
=== RUN   TestMasterKey_Decrypt
--- PASS: TestMasterKey_Decrypt (1.00s)
=== RUN   TestMasterKey_EncryptDecrypt_RoundTrip
--- PASS: TestMasterKey_EncryptDecrypt_RoundTrip (0.48s)
...
PASS
ok  	go.mozilla.org/sops/v3/azkv	5.069s

Process finished with the exit code 0

@hiddeco
Copy link
Member Author

hiddeco commented Jul 13, 2022

Tested this with an EncryptedData value created with current develop, and it decrypts successfully with this branch.

@hiddeco hiddeco requested a review from ajvb July 19, 2022 18:55
@hiddeco hiddeco changed the title azkv: update Azure SDK to v0.6.0 azkv: update Azure SDK to v0.9.0 Nov 21, 2022
hiddeco and others added 5 commits July 3, 2023 21:34
This should be the last major change in their SDK with regard to
changing method signatures and/or the way the client is constructed.

I manually ran the integration test suite which passes without any
issues.

Signed-off-by: Hidde Beydals <hello@hidde.co>
The generated password from `az` does no longer appear to be a UUID,
but returns a random generated string instead.

Given there is also a UUID attached to Secret object that holds this
value, it is better to be explict to guide users.

In addition, the tenant is always a UUID (and not _any_ ID).

Signed-off-by: Hidde Beydals <hello@hidde.co>
Besides some signature changes, really nothing special.

```
$ go test --tags integration ./... -v
=== RUN   TestMasterKey_Encrypt
--- PASS: TestMasterKey_Encrypt (1.34s)
=== RUN   TestMasterKey_Decrypt
--- PASS: TestMasterKey_Decrypt (0.68s)
=== RUN   TestMasterKey_EncryptDecrypt_RoundTrip
--- PASS: TestMasterKey_EncryptDecrypt_RoundTrip (0.40s)
=== RUN   TestNewMasterKeyFromURL
=== RUN   TestNewMasterKeyFromURL/URL
=== RUN   TestNewMasterKeyFromURL/malformed_URL
--- PASS: TestNewMasterKeyFromURL (0.00s)
    --- PASS: TestNewMasterKeyFromURL/URL (0.00s)
    --- PASS: TestNewMasterKeyFromURL/malformed_URL (0.00s)
=== RUN   TestMasterKeysFromURLs
=== RUN   TestMasterKeysFromURLs/single_URL
=== RUN   TestMasterKeysFromURLs/multiple_URLs
=== RUN   TestMasterKeysFromURLs/multiple_URLs,_one_malformed
=== RUN   TestMasterKeysFromURLs/empty
--- PASS: TestMasterKeysFromURLs (0.00s)
    --- PASS: TestMasterKeysFromURLs/single_URL (0.00s)
    --- PASS: TestMasterKeysFromURLs/multiple_URLs (0.00s)
    --- PASS: TestMasterKeysFromURLs/multiple_URLs,_one_malformed (0.00s)
    --- PASS: TestMasterKeysFromURLs/empty (0.00s)
=== RUN   TestTokenCredential_ApplyToMasterKey
--- PASS: TestTokenCredential_ApplyToMasterKey (0.00s)
=== RUN   TestMasterKey_EncryptedDataKey
--- PASS: TestMasterKey_EncryptedDataKey (0.00s)
=== RUN   TestMasterKey_SetEncryptedDataKey
--- PASS: TestMasterKey_SetEncryptedDataKey (0.00s)
=== RUN   TestMasterKey_EncryptIfNeeded
=== RUN   TestMasterKey_EncryptIfNeeded/not_encrypted
[AZKV]   time="2022-11-21T20:41:58Z" level=error msg="Encryption failed" key=test-key version=a2a690a4fcc04166b739da342a912c90
=== RUN   TestMasterKey_EncryptIfNeeded/already_encrypted
--- PASS: TestMasterKey_EncryptIfNeeded (2.12s)
    --- PASS: TestMasterKey_EncryptIfNeeded/not_encrypted (2.12s)
    --- PASS: TestMasterKey_EncryptIfNeeded/already_encrypted (0.00s)
=== RUN   TestMasterKey_NeedsRotation
--- PASS: TestMasterKey_NeedsRotation (0.00s)
=== RUN   TestMasterKey_ToString
--- PASS: TestMasterKey_ToString (0.00s)
=== RUN   TestMasterKey_ToMap
--- PASS: TestMasterKey_ToMap (0.00s)
=== RUN   TestMasterKey_getTokenCredential
=== RUN   TestMasterKey_getTokenCredential/with_TokenCredential
=== RUN   TestMasterKey_getTokenCredential/default
--- PASS: TestMasterKey_getTokenCredential (0.00s)
    --- PASS: TestMasterKey_getTokenCredential/with_TokenCredential (0.00s)
    --- PASS: TestMasterKey_getTokenCredential/default (0.00s)
PASS
ok      go.mozilla.org/sops/v3/azkv     4.551s
```

Signed-off-by: Hidde Beydals <hello@hidde.co>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
- github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.1 -> v1.6.1
- github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1 -> v1.3.0
- github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0 -> v0.10.0

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
@hiddeco hiddeco requested review from a team and removed request for ajvb July 3, 2023 19:41
@hiddeco hiddeco changed the title azkv: update Azure SDK to v0.9.0 azkv: update Azure SDK to v0.10.0 Jul 3, 2023
@hiddeco hiddeco added this to the v3.8.0 milestone Jul 3, 2023
@hiddeco hiddeco merged commit 4eaecad into getsops:develop Jul 4, 2023
@hiddeco hiddeco deleted the azkv-update-sdk branch July 4, 2023 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants