localsecrets

package
v0.0.229 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserBundleName      = "user.secrets"
	WorkspaceBundleName = "workspace.secrets"
	ServerBundleName    = "server.secrets"
)

Variables

View Source
var File_framework_secrets_localsecrets_bundle_proto protoreflect.FileDescriptor

Functions

func DescribeKey

func DescribeKey(out io.Writer, key *ValueKey)

func NewLocalSecrets

func NewLocalSecrets(env SecretsContext) (secrets.SecretsSource, error)

func OutputBase64

func OutputBase64(w io.Writer, buf []byte) error

Types

type Bundle

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

func LoadBundle

func LoadBundle(ctx context.Context, keyDir fs.FS, raw []byte) (*Bundle, error)

func NewBundle

func NewBundle(ctx context.Context, keyID string) (*Bundle, error)

func (*Bundle) Definitions

func (b *Bundle) Definitions() []*Manifest_Definition

func (*Bundle) Delete

func (b *Bundle) Delete(packageName, key string) bool

func (*Bundle) DescribeTo

func (b *Bundle) DescribeTo(out io.Writer)

func (*Bundle) EnsureReader

func (b *Bundle) EnsureReader(pubkey string) error

func (*Bundle) Lookup

func (b *Bundle) Lookup(ctx context.Context, key *ValueKey) ([]byte, error)

func (*Bundle) LookupValues

func (b *Bundle) LookupValues(ctx context.Context, key *ValueKey) ([]LookupResult, error)

func (*Bundle) Readers

func (b *Bundle) Readers() []*Manifest_Reader

func (*Bundle) SerializeTo

func (b *Bundle) SerializeTo(ctx context.Context, w io.Writer, encrypt bool) error

func (*Bundle) Set

func (b *Bundle) Set(k *ValueKey, value []byte)

func (*Bundle) SetReaders

func (b *Bundle) SetReaders(pubkeys []string) error

func (*Bundle) WasEncrypted

func (b *Bundle) WasEncrypted(key *ValueKey) (bool, bool)

type LookupResult

type LookupResult struct {
	Key   *ValueKey
	Value []byte
}

type Manifest

type Manifest struct {
	Definition []*Manifest_Definition      `protobuf:"bytes,1,rep,name=definition,proto3" json:"definition,omitempty"`
	Values     []*Manifest_BundleReference `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
	Reader     []*Manifest_Reader          `protobuf:"bytes,3,rep,name=reader,proto3" json:"reader,omitempty"` // Set of identities that have access to the encrypted values.
	// contains filtered or unexported fields
}

func (*Manifest) Descriptor deprecated

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

Deprecated: Use Manifest.ProtoReflect.Descriptor instead.

func (*Manifest) GetDefinition

func (x *Manifest) GetDefinition() []*Manifest_Definition

func (*Manifest) GetReader

func (x *Manifest) GetReader() []*Manifest_Reader

func (*Manifest) GetValues

func (x *Manifest) GetValues() []*Manifest_BundleReference

func (*Manifest) ProtoMessage

func (*Manifest) ProtoMessage()

func (*Manifest) ProtoReflect

func (x *Manifest) ProtoReflect() protoreflect.Message

func (*Manifest) Reset

func (x *Manifest) Reset()

func (*Manifest) String

func (x *Manifest) String() string

type Manifest_BundleReference

type Manifest_BundleReference struct {
	Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"`               // Absolute location within the bundle.
	RawText  bool   `protobuf:"varint,2,opt,name=raw_text,json=rawText,proto3" json:"raw_text,omitempty"` // If true, the bundle is unencrypted. Use exclusively for testing.
	// contains filtered or unexported fields
}

func (*Manifest_BundleReference) Descriptor deprecated

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

Deprecated: Use Manifest_BundleReference.ProtoReflect.Descriptor instead.

func (*Manifest_BundleReference) GetFilename

func (x *Manifest_BundleReference) GetFilename() string

func (*Manifest_BundleReference) GetRawText

func (x *Manifest_BundleReference) GetRawText() bool

func (*Manifest_BundleReference) ProtoMessage

func (*Manifest_BundleReference) ProtoMessage()

func (*Manifest_BundleReference) ProtoReflect

func (x *Manifest_BundleReference) ProtoReflect() protoreflect.Message

func (*Manifest_BundleReference) Reset

func (x *Manifest_BundleReference) Reset()

func (*Manifest_BundleReference) String

func (x *Manifest_BundleReference) String() string

type Manifest_Definition

type Manifest_Definition struct {
	Key *ValueKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

Definitions are not encrypted, so anyone can list the contents of the bundle, but not their values.

func (*Manifest_Definition) Descriptor deprecated

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

Deprecated: Use Manifest_Definition.ProtoReflect.Descriptor instead.

func (*Manifest_Definition) GetKey

func (x *Manifest_Definition) GetKey() *ValueKey

func (*Manifest_Definition) ProtoMessage

func (*Manifest_Definition) ProtoMessage()

func (*Manifest_Definition) ProtoReflect

func (x *Manifest_Definition) ProtoReflect() protoreflect.Message

func (*Manifest_Definition) Reset

func (x *Manifest_Definition) Reset()

func (*Manifest_Definition) String

func (x *Manifest_Definition) String() string

type Manifest_Reader

type Manifest_Reader struct {
	PublicKey   string `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*Manifest_Reader) Descriptor deprecated

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

Deprecated: Use Manifest_Reader.ProtoReflect.Descriptor instead.

func (*Manifest_Reader) GetDescription

func (x *Manifest_Reader) GetDescription() string

func (*Manifest_Reader) GetPublicKey

func (x *Manifest_Reader) GetPublicKey() string

func (*Manifest_Reader) ProtoMessage

func (*Manifest_Reader) ProtoMessage()

func (*Manifest_Reader) ProtoReflect

func (x *Manifest_Reader) ProtoReflect() protoreflect.Message

func (*Manifest_Reader) Reset

func (x *Manifest_Reader) Reset()

func (*Manifest_Reader) String

func (x *Manifest_Reader) String() string

type SecretsContext

type SecretsContext interface {
	Workspace() cfg.Workspace
	Environment() *schema.Environment
}

type ValueDatabase

type ValueDatabase struct {
	Value []*ValueDatabase_Value `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Contents of manifest.json found inside of an encrypted bundle.

func (*ValueDatabase) Descriptor deprecated

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

Deprecated: Use ValueDatabase.ProtoReflect.Descriptor instead.

func (*ValueDatabase) GetValue

func (x *ValueDatabase) GetValue() []*ValueDatabase_Value

func (*ValueDatabase) ProtoMessage

func (*ValueDatabase) ProtoMessage()

func (*ValueDatabase) ProtoReflect

func (x *ValueDatabase) ProtoReflect() protoreflect.Message

func (*ValueDatabase) Reset

func (x *ValueDatabase) Reset()

func (*ValueDatabase) String

func (x *ValueDatabase) String() string

type ValueDatabase_Value

type ValueDatabase_Value struct {
	Key      *ValueKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	FromPath string    `protobuf:"bytes,2,opt,name=from_path,json=fromPath,proto3" json:"from_path,omitempty"` // If specified, value is the contents of the filename, absolute path within the encrypted bundle
	Value    []byte    `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`                       // Inline secret value.
	// contains filtered or unexported fields
}

func (*ValueDatabase_Value) Descriptor deprecated

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

Deprecated: Use ValueDatabase_Value.ProtoReflect.Descriptor instead.

func (*ValueDatabase_Value) GetFromPath

func (x *ValueDatabase_Value) GetFromPath() string

func (*ValueDatabase_Value) GetKey

func (x *ValueDatabase_Value) GetKey() *ValueKey

func (*ValueDatabase_Value) GetValue

func (x *ValueDatabase_Value) GetValue() []byte

func (*ValueDatabase_Value) ProtoMessage

func (*ValueDatabase_Value) ProtoMessage()

func (*ValueDatabase_Value) ProtoReflect

func (x *ValueDatabase_Value) ProtoReflect() protoreflect.Message

func (*ValueDatabase_Value) Reset

func (x *ValueDatabase_Value) Reset()

func (*ValueDatabase_Value) String

func (x *ValueDatabase_Value) String() string

type ValueKey

type ValueKey struct {
	PackageName     string `protobuf:"bytes,1,opt,name=package_name,json=packageName,proto3" json:"package_name,omitempty"`
	Key             string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	EnvironmentName string `protobuf:"bytes,3,opt,name=environment_name,json=environmentName,proto3" json:"environment_name,omitempty"`
	// contains filtered or unexported fields
}

func (*ValueKey) Descriptor deprecated

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

Deprecated: Use ValueKey.ProtoReflect.Descriptor instead.

func (*ValueKey) GetEnvironmentName

func (x *ValueKey) GetEnvironmentName() string

func (*ValueKey) GetKey

func (x *ValueKey) GetKey() string

func (*ValueKey) GetPackageName

func (x *ValueKey) GetPackageName() string

func (*ValueKey) ProtoMessage

func (*ValueKey) ProtoMessage()

func (*ValueKey) ProtoReflect

func (x *ValueKey) ProtoReflect() protoreflect.Message

func (*ValueKey) Reset

func (x *ValueKey) Reset()

func (*ValueKey) String

func (x *ValueKey) String() string

Jump to

Keyboard shortcuts

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