httpclient

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.Client
}

Client calls the credential API, which credential/httphandler serves

func New

func New(url string, opts ...client.ClientOpt) (*Client, error)

New returns a client of the credential API at the URL, such as "http://localhost:8080/api"

func (*Client) DeleteCredential

func (c *Client) DeleteCredential(ctx context.Context, key string) error

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

func (c *Client) GetCredential(ctx context.Context, key, passphrase string, result any) error

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

func (c *Client) RotateCredential(ctx context.Context, key string) error

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

Jump to

Keyboard shortcuts

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