cockroach: github.com/cockroachdb/cockroach/pkg/ccl/baseccl Index | Files

package baseccl

import "github.com/cockroachdb/cockroach/pkg/ccl/baseccl"

Index

Package Files

encryption_options.pb.go encryption_spec.go

Constants

const DefaultRotationPeriod = time.Hour * 24 * 7 // 1 week, give or take time changes.

DefaultRotationPeriod is the rotation period used if not specified.

Variables

var (
    ErrInvalidLengthEncryptionOptions = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowEncryptionOptions   = fmt.Errorf("proto: integer overflow")
)
var EncryptionKeySource_name = map[int32]string{
    0: "KeyFiles",
}
var EncryptionKeySource_value = map[string]int32{
    "KeyFiles": 0,
}

func EncryptionOptionsForStore Uses

func EncryptionOptionsForStore(
    dir string, encryptionSpecs StoreEncryptionSpecList,
) ([]byte, error)

EncryptionOptionsForStore takes a store directory and returns its ExtraOptions if a matching entry if found in the StoreEncryptionSpecList. The caller should appropriately set UseFileRegistry on a non-nil result.

func PopulateStoreSpecWithEncryption Uses

func PopulateStoreSpecWithEncryption(
    storeSpecs base.StoreSpecList, encryptionSpecs StoreEncryptionSpecList,
) error

PopulateStoreSpecWithEncryption iterates through the StoreEncryptionSpecList and looks for matching paths in the StoreSpecList. Any unmatched StoreEncryptionSpec causes an error. Matching stores have a few encryption-related fields set.

type EncryptionKeyFiles Uses

type EncryptionKeyFiles struct {
    CurrentKey string `protobuf:"bytes,1,opt,name=current_key,json=currentKey,proto3" json:"current_key,omitempty"`
    OldKey     string `protobuf:"bytes,2,opt,name=old_key,json=oldKey,proto3" json:"old_key,omitempty"`
}

EncryptionKeyFiles is used when plain key files are passed.

func (*EncryptionKeyFiles) Descriptor Uses

func (*EncryptionKeyFiles) Descriptor() ([]byte, []int)

func (*EncryptionKeyFiles) Marshal Uses

func (m *EncryptionKeyFiles) Marshal() (dAtA []byte, err error)

func (*EncryptionKeyFiles) MarshalTo Uses

func (m *EncryptionKeyFiles) MarshalTo(dAtA []byte) (int, error)

func (*EncryptionKeyFiles) ProtoMessage Uses

func (*EncryptionKeyFiles) ProtoMessage()

func (*EncryptionKeyFiles) Reset Uses

func (m *EncryptionKeyFiles) Reset()

func (*EncryptionKeyFiles) Size Uses

func (m *EncryptionKeyFiles) Size() (n int)

func (*EncryptionKeyFiles) String Uses

func (m *EncryptionKeyFiles) String() string

func (*EncryptionKeyFiles) Unmarshal Uses

func (m *EncryptionKeyFiles) Unmarshal(dAtA []byte) error

func (*EncryptionKeyFiles) XXX_DiscardUnknown Uses

func (m *EncryptionKeyFiles) XXX_DiscardUnknown()

func (*EncryptionKeyFiles) XXX_Marshal Uses

func (m *EncryptionKeyFiles) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EncryptionKeyFiles) XXX_Merge Uses

func (dst *EncryptionKeyFiles) XXX_Merge(src proto.Message)

func (*EncryptionKeyFiles) XXX_Size Uses

func (m *EncryptionKeyFiles) XXX_Size() int

func (*EncryptionKeyFiles) XXX_Unmarshal Uses

func (m *EncryptionKeyFiles) XXX_Unmarshal(b []byte) error

type EncryptionKeySource Uses

type EncryptionKeySource int32
const (
    // Plain key files.
    EncryptionKeySource_KeyFiles EncryptionKeySource = 0
)

func (EncryptionKeySource) EnumDescriptor Uses

func (EncryptionKeySource) EnumDescriptor() ([]byte, []int)

func (EncryptionKeySource) String Uses

func (x EncryptionKeySource) String() string

type EncryptionOptions Uses

type EncryptionOptions struct {
    // The store key source. Defines which fields are useful.
    KeySource EncryptionKeySource `protobuf:"varint,1,opt,name=key_source,json=keySource,proto3,enum=cockroach.ccl.baseccl.EncryptionKeySource" json:"key_source,omitempty"`
    // Set if key_source == KeyFiles.
    KeyFiles *EncryptionKeyFiles `protobuf:"bytes,2,opt,name=key_files,json=keyFiles,proto3" json:"key_files,omitempty"`
    // Default data key rotation in seconds.
    DataKeyRotationPeriod int64 `protobuf:"varint,3,opt,name=data_key_rotation_period,json=dataKeyRotationPeriod,proto3" json:"data_key_rotation_period,omitempty"`
}

EncryptionOptions defines the per-store encryption options.

func (*EncryptionOptions) Descriptor Uses

func (*EncryptionOptions) Descriptor() ([]byte, []int)

func (*EncryptionOptions) Marshal Uses

func (m *EncryptionOptions) Marshal() (dAtA []byte, err error)

func (*EncryptionOptions) MarshalTo Uses

func (m *EncryptionOptions) MarshalTo(dAtA []byte) (int, error)

func (*EncryptionOptions) ProtoMessage Uses

func (*EncryptionOptions) ProtoMessage()

func (*EncryptionOptions) Reset Uses

func (m *EncryptionOptions) Reset()

func (*EncryptionOptions) Size Uses

func (m *EncryptionOptions) Size() (n int)

func (*EncryptionOptions) String Uses

func (m *EncryptionOptions) String() string

func (*EncryptionOptions) Unmarshal Uses

func (m *EncryptionOptions) Unmarshal(dAtA []byte) error

func (*EncryptionOptions) XXX_DiscardUnknown Uses

func (m *EncryptionOptions) XXX_DiscardUnknown()

func (*EncryptionOptions) XXX_Marshal Uses

func (m *EncryptionOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EncryptionOptions) XXX_Merge Uses

func (dst *EncryptionOptions) XXX_Merge(src proto.Message)

func (*EncryptionOptions) XXX_Size Uses

func (m *EncryptionOptions) XXX_Size() int

func (*EncryptionOptions) XXX_Unmarshal Uses

func (m *EncryptionOptions) XXX_Unmarshal(b []byte) error

type StoreEncryptionSpec Uses

type StoreEncryptionSpec struct {
    Path           string
    KeyPath        string
    OldKeyPath     string
    RotationPeriod time.Duration
}

StoreEncryptionSpec contains the details that can be specified in the cli via the --enterprise-encryption flag.

func NewStoreEncryptionSpec Uses

func NewStoreEncryptionSpec(value string) (StoreEncryptionSpec, error)

NewStoreEncryptionSpec parses the string passed in and returns a new StoreEncryptionSpec if parsing succeeds. TODO(mberhault): we should share the parsing code with the StoreSpec.

func (StoreEncryptionSpec) String Uses

func (es StoreEncryptionSpec) String() string

String returns a fully parsable version of the encryption spec.

type StoreEncryptionSpecList Uses

type StoreEncryptionSpecList struct {
    Specs []StoreEncryptionSpec
}

StoreEncryptionSpecList contains a slice of StoreEncryptionSpecs that implements pflag's value interface.

func (*StoreEncryptionSpecList) Set Uses

func (encl *StoreEncryptionSpecList) Set(value string) error

Set adds a new value to the StoreEncryptionSpecValue. It is the important part of pflag's value interface.

func (StoreEncryptionSpecList) String Uses

func (encl StoreEncryptionSpecList) String() string

String returns a string representation of all the StoreEncryptionSpecs. This is part of pflag's value interface.

func (*StoreEncryptionSpecList) Type Uses

func (encl *StoreEncryptionSpecList) Type() string

Type returns the underlying type in string form. This is part of pflag's value interface.

Package baseccl imports 13 packages (graph) and is imported by 2 packages. Updated 2019-08-17. Refresh now. Tools for package owners.