secretsmanager

package
v0.0.0-...-756137a 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: 11 Imported by: 0

Documentation

Overview

Package secretsmanager provides the api client for the secretsmanager 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 {
	*commonsecretbackends.Client
	// contains filtered or unexported fields
}

Client is the api client for the SecretsManager facade.

func NewClient

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

NewClient creates a secrets api client.

func (*Client) CreateSecretURIs

func (c *Client) CreateSecretURIs(ctx context.Context, count int) ([]*coresecrets.URI, error)

CreateSecretURIs generates new secret URIs.

func (*Client) GetConsumerSecretsRevisionInfo

func (c *Client) GetConsumerSecretsRevisionInfo(ctx context.Context, unitName string, uris []string) (map[string]coresecrets.SecretRevisionInfo, error)

GetConsumerSecretsRevisionInfo returns the current revision and labels for secrets consumed by the specified unit.

func (*Client) Grant

Grant grants access to the specified secret.

func (*Client) Revoke

func (c *Client) Revoke(ctx context.Context, uri *coresecrets.URI, p *SecretRevokeGrantArgs) error

Revoke revokes access to the specified secret.

func (*Client) SecretMetadata

func (c *Client) SecretMetadata(ctx context.Context) ([]coresecrets.SecretOwnerMetadata, error)

SecretMetadata returns metadata for the specified secrets.

func (*Client) SecretRotated

func (c *Client) SecretRotated(ctx context.Context, uri string, oldRevision int) error

SecretRotated records the outcome of rotating a secret.

func (*Client) WatchConsumedSecretsChanges

func (c *Client) WatchConsumedSecretsChanges(ctx context.Context, unitName string) (watcher.StringsWatcher, error)

WatchConsumedSecretsChanges returns a watcher which serves changes to secrets payloads for any secrets consumed by the specified unit.

func (*Client) WatchObsolete

func (c *Client) WatchObsolete(ctx context.Context, ownerTags ...names.Tag) (watcher.StringsWatcher, error)

WatchObsolete returns a watcher for notifying when:

  • a secret owned by the entity is deleted
  • a secret revision owed by the entity no longer has any consumers

Obsolete revisions results are "uri/revno" and deleted secret results are "uri".

func (*Client) WatchSecretRevisionsExpiryChanges

func (c *Client) WatchSecretRevisionsExpiryChanges(ctx context.Context, ownerTags ...names.Tag) (watcher.SecretTriggerWatcher, error)

WatchSecretRevisionsExpiryChanges returns a watcher which serves changes to secret revision expiry config for any secrets managed by the specified owner.

func (*Client) WatchSecretsRotationChanges

func (c *Client) WatchSecretsRotationChanges(ctx context.Context, ownerTags ...names.Tag) (watcher.SecretTriggerWatcher, error)

WatchSecretsRotationChanges returns a watcher which serves changes to secrets rotation config for any secrets managed by the specified owner.

type Option

type Option = base.Option

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

type SecretRevokeGrantArgs

type SecretRevokeGrantArgs struct {
	ApplicationName *string
	UnitName        *string
	RelationKey     *string
	Role            coresecrets.SecretRole
}

SecretRevokeGrantArgs holds the args used to grant or revoke access to a secret. To grant access, specify one of ApplicationName or UnitName, plus optionally RelationId. To revoke access, specify one of ApplicationName or UnitName.

Jump to

Keyboard shortcuts

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