v1.3.1 Latest Latest

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0, BSD-3-Clause Imports: 3 Imported by: 0



Package secretstore provides a read-only interface to Fastly Compute Secret Stores.

Secret stores are persistent, globally distributed stores for secrets. Secrets are decrypted as-needed at the edge.

See the Fastly Secret Store documentation for details.



This section is empty.


View Source
var (
	// ErrSecretStoreNotFound indicates that the named secret store
	// doesn't exist.
	ErrSecretStoreNotFound = errors.New("secret store not found")

	// ErrInvalidSecretStoreName indicates that the given secret store
	// name is invalid.
	ErrInvalidSecretStoreName = errors.New("invalid secret store name")

	// ErrSecretNotFound indicates that the named secret doesn't exist
	// within this store.
	ErrSecretNotFound = errors.New("secret not found")

	// ErrInvalidSecretName indicates that the given secret name is
	// invalid.
	ErrInvalidSecretName = errors.New("invalid secret name")

	// ErrUnexpected indicates than an unexpected error occurred.
	ErrUnexpected = errors.New("unexpected error")


This section is empty.


type Secret

type Secret struct {
	// contains filtered or unexported fields

Secret represents a secret in a store

func SecretFromBytes added in v0.1.7

func SecretFromBytes(b []byte) (*Secret, error)

FromBytes creates an instance of the Secret type for use with APIs that require it from the provided byte slice.

This function is provided as a way to use data that should be secret, but is being obtained by some other means than a Fastly Secret Store. Secret values created this way are plaintext only, and are not shared with other sessions. This should only be used in situations in which an API requires a Secret, but you cannot (for whatever reason) use a Store to store them.

It is strongly suggested to store secrets in a Store and create Secret values by calling Store.Get.

func (*Secret) Plaintext

func (s *Secret) Plaintext() ([]byte, error)

Plaintext decrypts and returns the secret value as a byte slice.

type Store

type Store struct {
	// contains filtered or unexported fields

Store represents a Fastly Secret Store

func Open

func Open(name string) (*Store, error)

Open returns a handle to the named secret store, if it exists. It will return ErrSecretStoreNotFound if it doesn't exist.

func (*Store) Get

func (st *Store) Get(name string) (*Secret, error)

Get returns a handle to the named secret within the store, if it exists. It will return ErrSecretNotFound if it doesn't exist.

Jump to

Keyboard shortcuts

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