Documentation
¶
Index ¶
- type Client
- func (c *Client) DeleteCredential(ctx context.Context, key string) error
- func (c *Client) DescribeCredential(ctx context.Context, key, description string) (*credential.Credential, error)
- func (c *Client) GetCredential(ctx context.Context, key, passphrase string, result any) error
- func (c *Client) GetCredentialMeta(ctx context.Context, key string) (*credential.Credential, error)
- func (c *Client) ListCredentials(ctx context.Context) (*credential.CredentialList, error)
- func (c *Client) RotateCredential(ctx context.Context, key string) error
- func (c *Client) SetCredential(ctx context.Context, set credential.CredentialSet) (*credential.Credential, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client calls the credential API, which credential/httphandler serves
func New ¶
New returns a client of the credential API at the URL, such as "http://localhost:8080/api"
func (*Client) DeleteCredential ¶
DeleteCredential deletes the stored credential for the key
func (*Client) DescribeCredential ¶
func (c *Client) DescribeCredential(ctx context.Context, key, description string) (*credential.Credential, error)
DescribeCredential changes the description of the stored credential for the key, without its value, or removes it, when it's empty
func (*Client) GetCredential ¶
GetCredential gets the credential for the key, with the passphrase it was encrypted with, and decodes it into result, which can be any type the credential's JSON decodes into, such as a json.RawMessage. Only the backends which encrypt with their own passphrases return credentials.
func (*Client) GetCredentialMeta ¶
func (c *Client) GetCredentialMeta(ctx context.Context, key string) (*credential.Credential, error)
GetCredentialMeta returns the key of the stored credential, and the time it was last changed, without its value
func (*Client) ListCredentials ¶
func (c *Client) ListCredentials(ctx context.Context) (*credential.CredentialList, error)
ListCredentials returns the stored credentials, in key order, without their values
func (*Client) RotateCredential ¶
RotateCredential re-encrypts the credential for the key with the latest passphrase version. Returns auth.ErrNotModified when it already uses it.
func (*Client) SetCredential ¶
func (c *Client) SetCredential(ctx context.Context, set credential.CredentialSet) (*credential.Credential, error)
SetCredential stores the credential, whose value is JSON, replacing any credential with the key, and its description, when it's set, which is kept when it isn't, and removed when it's empty