github.com/olli-ai/jx/v2@v2.0.400-0.20210921045218-14731b4dd448/pkg/secreturl/client.go (about)

     1  package secreturl
     2  
     3  // Client is a simple interface for accessing vault-like secret storage URLs such as `vault.Client` or a file system we can use to
     4  // access secret files and values in helm.
     5  //go:generate pegomock generate github.com/olli-ai/jx/v2/pkg/secreturl Client -o mocks/secreturl_client.go
     6  type Client interface {
     7  	// Read reads a named secret from the vault
     8  	Read(secretName string) (map[string]interface{}, error)
     9  
    10  	// ReadObject reads a generic named object from vault.
    11  	// The secret _must_ be serializable to JSON.
    12  	ReadObject(secretName string, secret interface{}) error
    13  
    14  	// Write writes a named secret to the vault
    15  	Write(secretName string, data map[string]interface{}) (map[string]interface{}, error)
    16  
    17  	// WriteObject writes a generic named object to the vault.
    18  	// The secret _must_ be serializable to JSON.
    19  	WriteObject(secretName string, secret interface{}) (map[string]interface{}, error)
    20  
    21  	// ReplaceURIs will replace any vault: URIs in a string (or whatever URL scheme the secret URL client supports
    22  	ReplaceURIs(text string) (string, error)
    23  }