Add context-aware functions to vault/api (#14388)

This commit is contained in:
Anton Averchenkov
2022-03-23 17:47:43 -04:00
committed by GitHub
parent fea828993c
commit 8234a663e7
130 changed files with 2114 additions and 1463 deletions

View File

@@ -1,6 +1,7 @@
package command
import (
"context"
"strings"
"testing"
@@ -63,7 +64,7 @@ func TestAuditDisableCommand_Run(t *testing.T) {
client, closer := testVaultServer(t)
defer closer()
if err := client.Sys().EnableAuditWithOptions("file", &api.EnableAuditOptions{
if err := client.Sys().EnableAuditWithOptionsWithContext(context.Background(), "file", &api.EnableAuditOptions{
Type: "file",
Options: map[string]string{
"file_path": "discard",
@@ -93,7 +94,7 @@ func TestAuditDisableCommand_Run(t *testing.T) {
client, closer := testVaultServer(t)
defer closer()
if err := client.Sys().EnableAuditWithOptions("integration_audit_disable", &api.EnableAuditOptions{
if err := client.Sys().EnableAuditWithOptionsWithContext(context.Background(), "integration_audit_disable", &api.EnableAuditOptions{
Type: "file",
Options: map[string]string{
"file_path": "discard",
@@ -118,7 +119,7 @@ func TestAuditDisableCommand_Run(t *testing.T) {
t.Errorf("expected %q to contain %q", combined, expected)
}
mounts, err := client.Sys().ListMounts()
mounts, err := client.Sys().ListMountsWithContext(context.Background())
if err != nil {
t.Fatal(err)
}