secrets

package
v0.0.100 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GenerateSpecification_Format_name = map[int32]string{
		0: "FORMAT_UNKNOWN",
		1: "FORMAT_BASE64",
		2: "FORMAT_BASE32",
	}
	GenerateSpecification_Format_value = map[string]int32{
		"FORMAT_UNKNOWN": 0,
		"FORMAT_BASE64":  1,
		"FORMAT_BASE32":  2,
	}
)

Enum value maps for GenerateSpecification_Format.

View Source
var (
	ScopedMountPath = "/secrets"
	MountPath       = filepath.Join(ScopedMountPath, "server")
)
View Source
var File_std_secrets_provider_proto protoreflect.FileDescriptor
View Source
var (
	Package__ul2lm0 = &core.Package{
		PackageName: "namespacelabs.dev/foundation/std/secrets",
	}
)

Functions

func ServerSecretName

func ServerSecretName(srv *schema.Server) string

Types

type Collection

type Collection struct {
	DevMap         *SecretDevMap
	UserManaged    [][]*Secret // Indexing is the same as `DevMap.Configure`.
	InstanceOwners []string    // Indexing is the same as `DevMap.Configure`.
	Names          [][]string  // Indexing is the same as `DevMap.Configure`.
	Generated      []Generated
}

func Collect

func Collect(server *schema.Server) (*Collection, error)

func (*Collection) SecretsOf

func (col *Collection) SecretsOf(packageName string) []*SecretDevMap_SecretSpec

type GenerateSpecification

type GenerateSpecification struct {
	UniqueId        string                       `protobuf:"bytes,1,opt,name=unique_id,json=uniqueId,proto3" json:"unique_id,omitempty"` // If not set, will default to the package name of the caller.
	RandomByteCount int32                        `protobuf:"varint,2,opt,name=random_byte_count,json=randomByteCount,proto3" json:"random_byte_count,omitempty"`
	Format          GenerateSpecification_Format `protobuf:"varint,3,opt,name=format,proto3,enum=foundation.std.secrets.GenerateSpecification_Format" json:"format,omitempty"`
	// contains filtered or unexported fields
}

func (*GenerateSpecification) Descriptor deprecated

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

Deprecated: Use GenerateSpecification.ProtoReflect.Descriptor instead.

func (*GenerateSpecification) GetFormat

func (*GenerateSpecification) GetRandomByteCount

func (x *GenerateSpecification) GetRandomByteCount() int32

func (*GenerateSpecification) GetUniqueId

func (x *GenerateSpecification) GetUniqueId() string

func (*GenerateSpecification) ProtoMessage

func (*GenerateSpecification) ProtoMessage()

func (*GenerateSpecification) ProtoReflect

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

func (*GenerateSpecification) Reset

func (x *GenerateSpecification) Reset()

func (*GenerateSpecification) String

func (x *GenerateSpecification) String() string

type GenerateSpecification_Format

type GenerateSpecification_Format int32
const (
	GenerateSpecification_FORMAT_UNKNOWN GenerateSpecification_Format = 0 // Defaults to base64.
	GenerateSpecification_FORMAT_BASE64  GenerateSpecification_Format = 1
	GenerateSpecification_FORMAT_BASE32  GenerateSpecification_Format = 2
)

func (GenerateSpecification_Format) Descriptor

func (GenerateSpecification_Format) Enum

func (GenerateSpecification_Format) EnumDescriptor deprecated

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

Deprecated: Use GenerateSpecification_Format.Descriptor instead.

func (GenerateSpecification_Format) Number

func (GenerateSpecification_Format) String

func (GenerateSpecification_Format) Type

type Generated

type Generated struct {
	ID           string
	Path         string
	ResourceName string
	Secret       *Secret
}

type Secret

type Secret struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// If specified, a secret is generated according to the specification, rather than being user-specified.
	Generate                 *GenerateSpecification          `protobuf:"bytes,3,opt,name=generate,proto3" json:"generate,omitempty"`
	InitializeWith           *types.DeferredInvocationSource `protobuf:"bytes,4,opt,name=initialize_with,json=initializeWith,proto3" json:"initialize_with,omitempty"`
	SelfSignedTlsCertificate *types.TLSCertificateSpec       `` /* 137-byte string literal not displayed */
	// By default secrets are required.
	Optional                  bool   `protobuf:"varint,5,opt,name=optional,proto3" json:"optional,omitempty"`
	ExperimentalMountAsEnvVar string `` /* 142-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Secret) Descriptor deprecated

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

Deprecated: Use Secret.ProtoReflect.Descriptor instead.

func (*Secret) GetExperimentalMountAsEnvVar

func (x *Secret) GetExperimentalMountAsEnvVar() string

func (*Secret) GetGenerate

func (x *Secret) GetGenerate() *GenerateSpecification

func (*Secret) GetInitializeWith

func (x *Secret) GetInitializeWith() *types.DeferredInvocationSource

func (*Secret) GetName

func (x *Secret) GetName() string

func (*Secret) GetOptional

func (x *Secret) GetOptional() bool

func (*Secret) GetSelfSignedTlsCertificate

func (x *Secret) GetSelfSignedTlsCertificate() *types.TLSCertificateSpec

func (*Secret) ProtoMessage

func (*Secret) ProtoMessage()

func (*Secret) ProtoReflect

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

func (*Secret) Reset

func (x *Secret) Reset()

func (*Secret) String

func (x *Secret) String() string

type SecretDevMap

type SecretDevMap struct {
	Configure []*SecretDevMap_Configure `protobuf:"bytes,1,rep,name=configure,proto3" json:"configure,omitempty"`
	// contains filtered or unexported fields
}

func LoadBinaryDevMap

func LoadBinaryDevMap(src fs.FS) (*SecretDevMap, error)

func LoadSourceDevMap

func LoadSourceDevMap(src fs.FS) (*SecretDevMap, error)

func (*SecretDevMap) Descriptor deprecated

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

Deprecated: Use SecretDevMap.ProtoReflect.Descriptor instead.

func (*SecretDevMap) GetConfigure

func (x *SecretDevMap) GetConfigure() []*SecretDevMap_Configure

func (*SecretDevMap) ProtoMessage

func (*SecretDevMap) ProtoMessage()

func (*SecretDevMap) ProtoReflect

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

func (*SecretDevMap) Reset

func (x *SecretDevMap) Reset()

func (*SecretDevMap) String

func (x *SecretDevMap) String() string

type SecretDevMap_Configure

type SecretDevMap_Configure struct {
	PackageName string                     `protobuf:"bytes,1,opt,name=package_name,json=packageName,proto3" json:"package_name,omitempty"`
	Secret      []*SecretDevMap_SecretSpec `protobuf:"bytes,2,rep,name=secret,proto3" json:"secret,omitempty"`
	// contains filtered or unexported fields
}

func LookupConfig

func LookupConfig(sdm *SecretDevMap, caller string) *SecretDevMap_Configure

func (*SecretDevMap_Configure) Descriptor deprecated

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

Deprecated: Use SecretDevMap_Configure.ProtoReflect.Descriptor instead.

func (*SecretDevMap_Configure) GetPackageName

func (x *SecretDevMap_Configure) GetPackageName() string

func (*SecretDevMap_Configure) GetSecret

func (*SecretDevMap_Configure) ProtoMessage

func (*SecretDevMap_Configure) ProtoMessage()

func (*SecretDevMap_Configure) ProtoReflect

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

func (*SecretDevMap_Configure) Reset

func (x *SecretDevMap_Configure) Reset()

func (*SecretDevMap_Configure) String

func (x *SecretDevMap_Configure) String() string

type SecretDevMap_SecretSpec

type SecretDevMap_SecretSpec struct {
	Name     string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	FromPath string `protobuf:"bytes,2,opt,name=from_path,json=fromPath,proto3" json:"from_path,omitempty"`
	// Runtime-specific specification. E.g. in Kubernetes would be actual secret name stored in Kubernetes.
	ResourceName string `protobuf:"bytes,4,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"`
	// contains filtered or unexported fields
}

func (*SecretDevMap_SecretSpec) Descriptor deprecated

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

Deprecated: Use SecretDevMap_SecretSpec.ProtoReflect.Descriptor instead.

func (*SecretDevMap_SecretSpec) GetFromPath

func (x *SecretDevMap_SecretSpec) GetFromPath() string

func (*SecretDevMap_SecretSpec) GetName

func (x *SecretDevMap_SecretSpec) GetName() string

func (*SecretDevMap_SecretSpec) GetResourceName

func (x *SecretDevMap_SecretSpec) GetResourceName() string

func (*SecretDevMap_SecretSpec) ProtoMessage

func (*SecretDevMap_SecretSpec) ProtoMessage()

func (*SecretDevMap_SecretSpec) ProtoReflect

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

func (*SecretDevMap_SecretSpec) Reset

func (x *SecretDevMap_SecretSpec) Reset()

func (*SecretDevMap_SecretSpec) String

func (x *SecretDevMap_SecretSpec) String() string

type Secrets

type Secrets struct {
	Secret []*Secret `protobuf:"bytes,1,rep,name=secret,proto3" json:"secret,omitempty"`
	// contains filtered or unexported fields
}

func (*Secrets) Descriptor deprecated

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

Deprecated: Use Secrets.ProtoReflect.Descriptor instead.

func (*Secrets) GetSecret

func (x *Secrets) GetSecret() []*Secret

func (*Secrets) ProtoMessage

func (*Secrets) ProtoMessage()

func (*Secrets) ProtoReflect

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

func (*Secrets) Reset

func (x *Secrets) Reset()

func (*Secrets) String

func (x *Secrets) String() string

type Value

type Value struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

func ProvideSecret

func ProvideSecret(ctx context.Context, req *Secret) (*Value, error)

func (*Value) Descriptor deprecated

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

Deprecated: Use Value.ProtoReflect.Descriptor instead.

func (*Value) GetName

func (x *Value) GetName() string

func (*Value) GetPath

func (x *Value) GetPath() string

func (*Value) MustValue

func (v *Value) MustValue() []byte

func (*Value) ProtoMessage

func (*Value) ProtoMessage()

func (*Value) ProtoReflect

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

func (*Value) Reset

func (x *Value) Reset()

func (*Value) String

func (x *Value) String() string

func (*Value) Value

func (v *Value) Value() ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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