tmkms

package
v1.49.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKeyType         = "bech32"
	DefaultAccountPrefix   = "nibipub"
	DefaultConsensusPrefix = "nibivalconspub"
)
View Source
const (
	DefaultTmKmsImage = "ghcr.io/iqlusioninc/tmkms"

	DefaultTmkmsCpu    = "100m"
	DefaultTmkmsMemory = "64Mi"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainConfig

type ChainConfig struct {
	ChainID   string     `toml:"id"`
	KeyFormat *KeyFormat `toml:"key_format"`
	StateFile string     `toml:"state_file"`
}

type ChainOption

type ChainOption func(*ChainConfig)

func WithKeyFormat

func WithKeyFormat(keyType, accountKeyPrefix, consensusKeyPrefix string) ChainOption

type Config

type Config struct {
	Image        string                      `toml:"-"`
	Chains       []*ChainConfig              `toml:"chain"`
	Validators   []*ValidatorConfig          `toml:"validator"`
	Providers    map[string][]Provider       `toml:"providers"`
	PersistState bool                        `toml:"-"`
	Resources    corev1.ResourceRequirements `toml:"-"`
}

type HashicorpAdapter

type HashicorpAdapter struct {
	VaultAddress    string                    `toml:"vault_addr"`
	VaultCaCert     string                    `toml:"vault_cacert,omitempty"`
	VaultSkipVerify bool                      `toml:"vault_skip_verify,omitempty"`
	CachePublicKey  bool                      `toml:"cache_pk,omitempty"`
	Endpoints       *HashicorpEndpointsConfig `toml:"endpoints,omitempty"`
}

type HashicorpAuth

type HashicorpAuth struct {
	AccessToken     string `toml:"access_token,omitempty"`
	AccessTokenFile string `toml:"access_token_file,omitempty"`
}

type HashicorpEndpointsConfig

type HashicorpEndpointsConfig struct {
	Keys        string `toml:"keys"`
	HandShake   string `toml:"hand_shake"`
	WrappingKey string `toml:"wrapping_key"`
	Sign        string `toml:"sign"`
}

type HashicorpKey

type HashicorpKey struct {
	ChainID string         `toml:"chain_id"`
	Key     string         `toml:"key"`
	KeyType string         `toml:"key_type,omitempty"`
	Auth    *HashicorpAuth `toml:"auth"`
}

type HashicorpProvider

type HashicorpProvider struct {
	Keys    []*HashicorpKey   `toml:"keys"`
	Adapter *HashicorpAdapter `toml:"adapter"`

	CertificateSecret *corev1.SecretKeySelector `toml:"-"`
	TokenSecret       *corev1.SecretKeySelector `toml:"-"`
	AutoRenewToken    bool                      `toml:"-"`
}

func (HashicorpProvider) UploadKey

func (v HashicorpProvider) UploadKey(ctx context.Context, kms *KMS, key string) error

type KMS

type KMS struct {
	Name   string
	Owner  metav1.Object
	Client *kubernetes.Clientset
	Scheme *runtime.Scheme
	Config *Config
}

func New

func New(client *kubernetes.Clientset, scheme *runtime.Scheme, name string, owner metav1.Object, opts ...Option) *KMS

func (*KMS) DeployConfig

func (kms *KMS) DeployConfig(ctx context.Context) error

func (*KMS) GetContainersSpec

func (kms *KMS) GetContainersSpec() []corev1.Container

func (*KMS) GetVolumes

func (kms *KMS) GetVolumes() []corev1.Volume

func (*KMS) UndeployConfig

func (kms *KMS) UndeployConfig(ctx context.Context) error

type KeyFormat

type KeyFormat struct {
	Type               string `toml:"type"`
	AccountKeyPrefix   string `toml:"account_key_prefix"`
	ConsensusKeyPrefix string `toml:"consensus_key_prefix"`
}

type Option

type Option func(*Config)

func PersistState

func PersistState(b bool) Option

func WithChain

func WithChain(chainID string, opts ...ChainOption) Option

func WithImage

func WithImage(s string) Option

func WithProvider

func WithProvider(p Provider) Option

func WithResources

func WithResources(res corev1.ResourceRequirements) Option

func WithValidator

func WithValidator(chainID, address string, opts ...ValidatorOption) Option

type ProtocolVersion

type ProtocolVersion string
const (
	ProtocolVersionLegacy ProtocolVersion = "legacy"
	ProtocolVersionV0_33  ProtocolVersion = "v0.33"
	ProtocolVersionV0_34  ProtocolVersion = "v0.34"
)

type Provider

type Provider interface {
	// contains filtered or unexported methods
}

func NewHashicorpProvider

func NewHashicorpProvider(chainID, address, key string, token, ca *corev1.SecretKeySelector, autoRenewToken, skipVerify bool) Provider

type ValidatorConfig

type ValidatorConfig struct {
	ChainID         string          `toml:"chain_id"`
	Address         string          `toml:"addr"`
	ProtocolVersion ProtocolVersion `toml:"protocol_version"`
	Reconnect       bool            `toml:"reconnect"`
	SecretKey       string          `toml:"secret_key"`
}

type ValidatorOption

type ValidatorOption func(*ValidatorConfig)

func WithProtocolVersion

func WithProtocolVersion(v ProtocolVersion) ValidatorOption

func WithReconnect

func WithReconnect(v bool) ValidatorOption

Jump to

Keyboard shortcuts

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