deps: update Go to v1.24.2 (#3750)

* deps: update Go to v1.24.2
* tests: replace context.Background() with t.Context()

---------

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2025-04-09 10:54:28 +02:00 committed by GitHub
parent a7f9561a3d
commit 4e5c213b4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
112 changed files with 287 additions and 316 deletions

View file

@ -32,23 +32,23 @@ func TestGetDataKey(t *testing.T) {
kms := &stubKMS{derivedKey: []byte{0x0, 0x1, 0x2, 0x3, 0x4, 0x5}}
api := New(log, kms)
res, err := api.GetDataKey(context.Background(), &keyserviceproto.GetDataKeyRequest{DataKeyId: "1", Length: 32})
res, err := api.GetDataKey(t.Context(), &keyserviceproto.GetDataKeyRequest{DataKeyId: "1", Length: 32})
require.NoError(err)
assert.Equal(kms.derivedKey, res.DataKey)
// Test no data key id
res, err = api.GetDataKey(context.Background(), &keyserviceproto.GetDataKeyRequest{Length: 32})
res, err = api.GetDataKey(t.Context(), &keyserviceproto.GetDataKeyRequest{Length: 32})
require.Error(err)
assert.Nil(res)
// Test no / zero key length
res, err = api.GetDataKey(context.Background(), &keyserviceproto.GetDataKeyRequest{DataKeyId: "1"})
res, err = api.GetDataKey(t.Context(), &keyserviceproto.GetDataKeyRequest{DataKeyId: "1"})
require.Error(err)
assert.Nil(res)
// Test derive key error
api = New(log, &stubKMS{deriveKeyErr: errors.New("error")})
res, err = api.GetDataKey(context.Background(), &keyserviceproto.GetDataKeyRequest{DataKeyId: "1", Length: 32})
res, err = api.GetDataKey(t.Context(), &keyserviceproto.GetDataKeyRequest{DataKeyId: "1", Length: 32})
assert.Error(err)
assert.Nil(res)
}