kubernetes/staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/config_test.go

const sampleText

const sampleContextText

var sampleInvalidKeyID

type testEnvelopeService

func (t *testEnvelopeService) Decrypt(data []byte) ([]byte, error) {}

func (t *testEnvelopeService) Encrypt(data []byte) ([]byte, error) {}

type testKMSv2EnvelopeService

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

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

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

// The factory method to create mock envelope service.
func newMockEnvelopeService(ctx context.Context, endpoint string, timeout time.Duration) (envelope.Service, error) {}

// The factory method to create mock envelope service which always returns error.
func newMockErrorEnvelopeService(endpoint string, timeout time.Duration) (envelope.Service, error) {}

// The factory method to create mock envelope kmsv2 service.
func newMockEnvelopeKMSv2Service(ctx context.Context, endpoint, providerName string, timeout time.Duration) (kmsservice.Service, error) {}

// The factory method to create mock envelope kmsv2 service which always returns error.
func newMockErrorEnvelopeKMSv2Service(endpoint string, timeout time.Duration) (kmsservice.Service, error) {}

// The factory method to create mock envelope kmsv2 service that always returns invalid keyID.
func newMockInvalidKeyIDEnvelopeKMSv2Service(ctx context.Context, endpoint string, timeout time.Duration, keyID string) (kmsservice.Service, error) {}

func TestLegacyConfig(t *testing.T) {}

func TestEncryptionProviderConfigCorrect(t *testing.T) {}

func TestKMSv1Deprecation(t *testing.T) {}

func TestKMSvsEnablement(t *testing.T) {}

func TestKMSMaxTimeout(t *testing.T) {}

func TestKMSPluginHealthz(t *testing.T) {}

// tests for masking rules
func TestWildcardMasking(t *testing.T) {}

func TestWildcardStructure(t *testing.T) {}

func TestKMSPluginHealthzTTL(t *testing.T) {}

func TestKMSv2PluginHealthzTTL(t *testing.T) {}

func TestKMSv2InvalidKeyID(t *testing.T) {}

func TestCBCKeyRotationWithOverlappingProviders(t *testing.T) {}

func TestCBCKeyRotationWithoutOverlappingProviders(t *testing.T) {}

func testCBCKeyRotationWithProviders(t *testing.T, firstEncryptionConfig, firstPrefix, secondEncryptionConfig, secondPrefix string) {}

func getTransformerFromEncryptionConfig(t *testing.T, encryptionConfigPath string) value.Transformer {}

func TestIsKMSv2ProviderHealthyError(t *testing.T) {}

// test to ensure KMSv2 API version is not changed after the first status response
func TestKMSv2SameVersionFromStatus(t *testing.T) {}

func testContext(t *testing.T) context.Context {}

func errString(err error) string {}

func TestComputeEncryptionConfigHash(t *testing.T) {}

func Test_kmsv2PluginProbe_rotateDEKOnKeyIDChange(t *testing.T) {}

func validState(t *testing.T, keyID string, exp time.Time, useSeed bool) envelopekmsv2.State {}

func logLines(logs string) []string {}

func TestGetEncryptionConfigHash(t *testing.T) {}