kubernetes/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/envelope_test.go

const testText

const testContextText

const testKeyHash

const testKeyVersion

const testAPIServerID

const testAPIServerIDHash

type testEnvelopeService

func (t *testEnvelopeService) Decrypt(ctx context.Context, uid string, req *kmsservice.DecryptRequest) ([]byte, error) {}

func (t *testEnvelopeService) Encrypt(ctx context.Context, uid string, data []byte) (*kmsservice.EncryptResponse, error) {}

func (t *testEnvelopeService) Status(ctx context.Context) (*kmsservice.StatusResponse, error) {}

func (t *testEnvelopeService) SetDisabledStatus(status bool) {}

func (t *testEnvelopeService) SetAnnotations(annotations map[string][]byte) {}

func (t *testEnvelopeService) SetCiphertext(ciphertext []byte) {}

func (t *testEnvelopeService) Rotate() {}

func newTestEnvelopeService() *testEnvelopeService {}

// Throw error if Envelope transformer tries to contact Envelope without hitting cache.
func TestEnvelopeCaching(t *testing.T) {}

func testStateFunc(ctx context.Context, envelopeService kmsservice.Service, clock clock.Clock, useSeed bool) func() (State, error) {}

// TestEnvelopeTransformerStaleness validates that staleness checks on read honor the data returned from the StateFunc.
func TestEnvelopeTransformerStaleness(t *testing.T) {}

func TestEnvelopeTransformerStateFunc(t *testing.T) {}

func TestTransformToStorageError(t *testing.T) {}

func TestEncodeDecode(t *testing.T) {}

func TestValidateEncryptedObject(t *testing.T) {}

func TestValidateAnnotations(t *testing.T) {}

func TestValidateKeyID(t *testing.T) {}

func TestValidateEncryptedDEKSource(t *testing.T) {}

func TestEnvelopeMetrics(t *testing.T) {}

// TestEnvelopeMetricsCache validates the correctness of the apiserver_envelope_encryption_dek_source_cache_size metric
// and asserts that all of the associated logic is go routine safe.
// 1. Multiple transformers are created, which should result in unique cache size for each provider
// 2. A transformer with known number of states was created to encrypt, then on restart, another transformer
// was created, which should result in expected number of cache keys for all the decryption calls for each
// state used previously for encryption.
func TestEnvelopeMetricsCache(t *testing.T) {}

var flagOnce

func TestEnvelopeLogging(t *testing.T) {}

func TestCacheNotCorrupted(t *testing.T) {}

func TestGenerateCacheKey(t *testing.T) {}

func TestGenerateTransformer(t *testing.T) {}

func TestEnvelopeTracing_TransformToStorage(t *testing.T) {}

func TestEnvelopeTracing_TransformFromStorage(t *testing.T) {}

func validateTraceSpan(t *testing.T, span trace.ReadOnlySpan, spanName, providerName, apiserverID string, expected []string) {}

func errString(err error) string {}

func randomBool() bool {}