Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var File_pasta_proto protoreflect.FileDescriptor
Functions ¶
func GenerateSecret ¶
GenerateSecret generates random bytes with CharsetAlphaNum
func HashByteSecret ¶
HashByteSecret hashes the secret for consumption by the AEAD encryption algorithm which expects exactly 32 bytes.
The system secret is being hashed to always match exactly the 32 bytes required by AEAD, even if the secret is long or shorter.
func HashStringSecret ¶
HashStringSecret hashes the secret for consumption by the AEAD encryption algorithm which expects exactly 32 bytes.
The system secret is being hashed to always match exactly the 32 bytes required by AEAD, even if the secret is long or shorter.
Types ¶
type CompletedConfig ¶
type CompletedConfig struct {
// contains filtered or unexported fields
}
func (CompletedConfig) New ¶
func (c CompletedConfig) New() *Pasta
New creates a new server which logically combines the handling chain with the passed server. name is used to differentiate for logging. The handler chain in particular can be difficult as it starts delgating. New usually called after Complete
type Config ¶
type Config struct { GetViper func() *viper.Viper // If set, overrides params below Proto Secret Validator *validator.Validate }
func NewViperConfig ¶ added in v0.0.17
NewViperConfig returns a Config struct with the global viper instance key representing a sub tree of this instance. NewViperConfig is case-insensitive for a key.
func (*Config) Complete ¶
func (o *Config) Complete() CompletedConfig
Complete fills in any fields not set that are required to have valid data and can be derived from other fields. If you're going to ApplyOptions, do that first. It's mutating the receiver. ApplyOptions is called inside.
type KeyProvider ¶
type Pasta ¶
type Pasta struct {
// contains filtered or unexported fields
}
copy & paste-friendly golang crypto
func New ¶
func New(c KeyProvider) *Pasta
func NewFromKey ¶
type Secret ¶ added in v0.0.17
type Secret struct { SystemSecret string `protobuf:"bytes,1,opt,name=system_secret,json=systemSecret,proto3" json:"system_secret,omitempty"` // new RotatedSystemSecrets []string `protobuf:"bytes,2,rep,name=rotated_system_secrets,json=rotatedSystemSecrets,proto3" json:"rotated_system_secrets,omitempty"` // old, older,..., oldest // contains filtered or unexported fields }
func (*Secret) Descriptor
deprecated
added in
v0.0.17
func (*Secret) GetRotatedSystemSecrets ¶ added in v0.0.17
func (*Secret) GetSystemSecret ¶ added in v0.0.23
func (*Secret) ProtoMessage ¶ added in v0.0.17
func (*Secret) ProtoMessage()
func (*Secret) ProtoReflect ¶ added in v0.0.17
func (x *Secret) ProtoReflect() protoreflect.Message