get.porter.sh/porter@v1.3.0/pkg/secrets/secrets.go (about)

     1  package secrets
     2  
     3  import (
     4  	"context"
     5  )
     6  
     7  const SourceSecret = "secret"
     8  
     9  // Store is the interface that Porter uses to interact with secrets.
    10  type Store interface {
    11  	Close() error
    12  
    13  	// Resolve a credential's value from a secret store
    14  	// - keyName is name of the key where the secret can be found.
    15  	// - keyValue is the value of the key.
    16  	// Examples:
    17  	// - keyName=env, keyValue=CONN_STRING
    18  	// - keyName=key, keyValue=conn-string
    19  	// - keyName=path, keyValue=/tmp/connstring.txt
    20  	Resolve(ctx context.Context, keyName string, keyValue string) (string, error)
    21  
    22  	// Create stores a secret value in a secret store.
    23  	// - keyName is name of the key where the secret can be found.
    24  	// - keyValue is the value of the key.
    25  	// Examples:
    26  	// - keyName=env, keyValue=CONN_STRING, value=redis://foo
    27  	// - keyName=key, keyValue=conn-string, value=redis://foo
    28  	// - keyName=path, keyValue=/tmp/connstring.txt, value=redis://foo
    29  	Create(ctx context.Context, keyName string, keyValue string, value string) error
    30  }