2021-10-27 09:37:14 -04:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
2023-02-02 17:15:17 -08:00
|
|
|
|
2021-10-27 09:37:14 -04:00
|
|
|
package api
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"reflect"
|
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
"github.com/hashicorp/eventlogger/filters/encrypt"
|
2022-03-16 17:04:07 -04:00
|
|
|
wrapping "github.com/hashicorp/go-kms-wrapping/v2"
|
2021-10-27 09:37:14 -04:00
|
|
|
"google.golang.org/protobuf/types/known/fieldmaskpb"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// NewEncryptFilter is a copy of event.NewEncryptFilter since importing it would
|
|
|
|
|
// case circular deps. The primary reason for this test func is to make sure
|
|
|
|
|
// the proper IgnoreTypes are included for testing.
|
2022-04-25 15:52:44 -04:00
|
|
|
func NewEncryptFilter(t testing.TB, w wrapping.Wrapper) *encrypt.Filter {
|
2021-10-27 09:37:14 -04:00
|
|
|
t.Helper()
|
|
|
|
|
return &encrypt.Filter{
|
|
|
|
|
Wrapper: w,
|
|
|
|
|
IgnoreTypes: []reflect.Type{
|
|
|
|
|
reflect.TypeOf(&fieldmaskpb.FieldMask{}),
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|