secrets

package
v0.0.0-...-1592773 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: AGPL-3.0 Imports: 7 Imported by: 2

Documentation

Overview

Package secrets provides the api client for the secrets facade.

Index

Constants

This section is empty.

Variables

View Source
var WithTracer = base.WithTracer

WithTracer returns an Option that configures the Client to use the supplied tracer.

Functions

This section is empty.

Types

type Client

type Client struct {
	base.ClientFacade
	// contains filtered or unexported fields
}

Client is the api client for the Secrets facade.

func NewClient

func NewClient(caller base.APICallCloser, options ...Option) *Client

NewClient creates a secrets api client.

func (*Client) CreateSecret

func (c *Client) CreateSecret(ctx context.Context, name, description string, data map[string]string) (string, error)

func (*Client) GrantSecret

func (c *Client) GrantSecret(ctx context.Context, uri *secrets.URI, name string, apps []string) ([]error, error)

GrantSecret grants access to a secret to the specified applications.

func (*Client) ListSecrets

func (api *Client) ListSecrets(ctx context.Context, reveal bool, filter secrets.Filter) ([]SecretDetails, error)

ListSecrets lists the available secrets.

func (*Client) RemoveSecret

func (c *Client) RemoveSecret(ctx context.Context, uri *secrets.URI, name string, revision *int) error

func (*Client) RevokeSecret

func (c *Client) RevokeSecret(ctx context.Context, uri *secrets.URI, name string, apps []string) ([]error, error)

RevokeSecret revokes access to a secret from the specified applications.

func (*Client) UpdateSecret

func (c *Client) UpdateSecret(
	ctx context.Context,
	uri *secrets.URI, name string, autoPrune *bool,
	newName string, description string, data map[string]string,
) error

UpdateSecret updates an existing secret.

type Option

type Option = base.Option

Option is a function that can be used to configure a Client.

type SecretDetails

type SecretDetails struct {
	Metadata  secrets.SecretMetadata
	Access    []secrets.AccessInfo
	Revisions []secrets.SecretRevisionMetadata
	Value     secrets.SecretValue
	Error     string
}

SecretDetails holds a secret metadata and value.

Jump to

Keyboard shortcuts

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