secret

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SecretNotFound is the error code returned when a secret is not found.
	SecretNotFound = "SecretNotFound"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client contains methods to call the Azure Key Vault REST API and base settings for handling the requests.

func NewClient

func NewClient(vault string, cred auth.Credential, options ...ClientOption) (*Client, error)

NewClient creates and returns a new *Client.

func (Client) Get

func (c Client) Get(ctx context.Context, name string, options ...Option) (Secret, error)

Get a secret.

func (Client) GetSecrets added in v0.10.0

func (c Client) GetSecrets(ctx context.Context, names []string, options ...Option) (map[string]Secret, error)

GetSecrets gets secrets by names.

func (*Client) SetVault added in v0.12.0

func (c *Client) SetVault(vault string)

SetVault sets the vault for the client.

func (Client) Vault added in v0.12.0

func (c Client) Vault() string

Vault returns the vault for the client.

type ClientOption

type ClientOption func(c *Client)

ClientOption is a function that sets options to *Client.

func WithClientVersions added in v0.22.0

func WithClientVersions(versions map[string]string) ClientOption

WithClientVersions sets secret versions on the secret client based on the provided map. The key of the map should be the secret name, and the value should be the version.

func WithCloud added in v0.14.0

func WithCloud(c cloud.Cloud) ClientOption

WithCloud sets the Azure cloud for secret retrieval.

func WithConcurrency

func WithConcurrency(n int) ClientOption

WithConcurrency sets the concurrency for secret retrieval.

func WithHTTPClient added in v0.22.0

func WithHTTPClient(client request.Client) ClientOption

WithHTTPClient sets the HTTP client for secret retrieval.

func WithRetryPolicy added in v0.12.0

func WithRetryPolicy(r httpr.RetryPolicy) ClientOption

WithRetryPolicy sets the retry policy for secret retrieval.

func WithTimeout

func WithTimeout(d time.Duration) ClientOption

WithTimeout sets timeout for secret retrieval.

type Option added in v0.10.0

type Option func(o *Options)

Option is a function that sets options for client operations.

func WithVersions added in v0.22.0

func WithVersions(versions map[string]string) Option

WithVersions sets secret versions on the secret requests based on the provided map. The key of the map should be the secret name, and the value should be the version. Overrides the versions set on the client.

type Options added in v0.10.0

type Options struct {
	Versions map[string]string
}

Options for client operations.

type Secret

type Secret struct {
	Value string `json:"value"`
}

Secret represents a secret as returned from the Key Vault REST API.

Jump to

Keyboard shortcuts

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