mirror of
https://github.com/minio/minio.git
synced 2025-11-25 03:56:17 -05:00
kms: add context.Context to KMS API calls (#15327)
This commit adds a `context.Context` to the
the KMS `{Stat, CreateKey, GenerateKey}` API
calls.
The context will be used to terminate external calls
as soon as the client requests gets canceled.
A follow-up PR will add a `context.Context` to
the remaining `DecryptKey` API call.
Signed-off-by: Andreas Auernhammer <hi@aead.dev>
This commit is contained in:
committed by
GitHub
parent
957e3ed729
commit
242d06274a
@@ -19,6 +19,7 @@ package kms
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"testing"
|
||||
)
|
||||
@@ -29,7 +30,7 @@ func TestSingleKeyRoundtrip(t *testing.T) {
|
||||
t.Fatalf("Failed to initialize KMS: %v", err)
|
||||
}
|
||||
|
||||
key, err := KMS.GenerateKey("my-key", Context{})
|
||||
key, err := KMS.GenerateKey(context.Background(), "my-key", Context{})
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to generate key: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user