client

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL   string
	HTTP      *http.Client
	Decryptor JWEDecryptor
}

func NewClient

func NewClient(serviceKey config.ServiceKey, decryptor JWEDecryptor, timeout time.Duration) (*Client, error)

func (*Client) GetKey

func (c *Client) GetKey(ctx context.Context, namespace, name string) (*KeyCredential, error)

func (*Client) GetPassword

func (c *Client) GetPassword(ctx context.Context, namespace, name string) (*PasswordCredential, error)

type JWEDecryptor

type JWEDecryptor struct {
	// contains filtered or unexported fields
}

func NewJWEDecryptor

func NewJWEDecryptor(serviceKey config.ServiceKey) (JWEDecryptor, error)

func (*JWEDecryptor) Decrypt

func (e *JWEDecryptor) Decrypt(data []byte) ([]byte, error)

type KeyCredential

type KeyCredential struct {
	ID         string `json:"id"`
	ModifiedAt string `json:"modifiedAt"`
	Name       string `json:"name"`
	Format     string `json:"format"`
	Username   string `json:"username"`
	Metadata   string `json:"metadata"`
	Value      string `json:"value"`
}

type PasswordCredential

type PasswordCredential struct {
	ID         string `json:"id"`
	ModifiedAt string `json:"modifiedAt"`
	Name       string `json:"name"`
	Username   string `json:"username"`
	Metadata   string `json:"metadata"`
	Value      string `json:"value"`
}

Jump to

Keyboard shortcuts

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