secretsmanager

package
v0.0.0-...-ac56535 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package secretsmanager provides the api client for the secretsmanager facade.

Index

Constants

This section is empty.

Variables

This section is empty.

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) *Client

NewClient creates a secrets api client.

func (*Client) CreateSecretURIs

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

CreateSecretURIs generates new secret URIs.

func (*Client) GetConsumerSecretsRevisionInfo

func (c *Client) GetConsumerSecretsRevisionInfo(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

func (c *Client) Grant(uri *coresecrets.URI, p *SecretRevokeGrantArgs) error

Grant grants access to the specified secret.

func (*Client) Revoke

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

Revoke revokes access to the specified secret.

func (*Client) SecretMetadata

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

SecretMetadata returns metadata for the specified secrets.

func (*Client) SecretRotated

func (c *Client) SecretRotated(uri string, oldRevision int) error

SecretRotated records the outcome of rotating a secret.

func (*Client) WatchConsumedSecretsChanges

func (c *Client) WatchConsumedSecretsChanges(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(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(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(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 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