transformer

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GRPCErrorCodeInvalidAccessData errs.GRPCErrorCode = "INVALID_ACCESS_DATA"
)

Variables

View Source
var (
	ErrValidateKey            = errors.New("failed to validate key")
	ErrSerializeKeyAccessData = errors.New("failed to serialize key access data")
	ErrExtractKeyRegion       = errors.New("failed to extract key region from provider")
	ErrGRPCInvalidAccessData  = errs.GRPCError{
		Code:        GRPCErrorCodeInvalidAccessData,
		BaseMessage: "failed to validate access data for the keystore provider",
	}
)

Functions

This section is empty.

Types

type PluginProviderTransformer

type PluginProviderTransformer struct {
	// contains filtered or unexported fields
}

func NewPluginProviderTransformer

func NewPluginProviderTransformer(pluginCatalog *catalog.Catalog, provider string) (*PluginProviderTransformer, error)

func (PluginProviderTransformer) GetRegion

func (v PluginProviderTransformer) GetRegion(
	ctx context.Context,
	key cmkapi.Key,
) (string, error)

func (PluginProviderTransformer) SerializeKeyAccessData

func (v PluginProviderTransformer) SerializeKeyAccessData(
	ctx context.Context,
	keyAccessDetails *cmkapi.KeyAccessDetails,
) (*SerializedKeyAccessData, error)

func (PluginProviderTransformer) ValidateAPI

func (v PluginProviderTransformer) ValidateAPI(ctx context.Context, k cmkapi.Key) error

func (PluginProviderTransformer) ValidateKeyAccessData

func (v PluginProviderTransformer) ValidateKeyAccessData(
	ctx context.Context,
	accessDetails *cmkapi.KeyAccessDetails,
) error

type ProviderTransformer

type ProviderTransformer interface {
	// ValidateAPI validates the key received from API requests against the provider's requirements.
	ValidateAPI(ctx context.Context, k cmkapi.Key) error

	ValidateKeyAccessData(ctx context.Context, k *cmkapi.KeyAccessDetails) error

	// SerializeKeyAccessData serializes the key access details into a format suitable for the provider.
	SerializeKeyAccessData(ctx context.Context, k *cmkapi.KeyAccessDetails) (*SerializedKeyAccessData, error)

	// GetRegion retrieves the region information for the given provider.
	GetRegion(ctx context.Context, k cmkapi.Key) (string, error)
}

type SerializedKeyAccessData

type SerializedKeyAccessData struct {
	Management []byte
	Crypto     []byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL