Documentation ¶
Index ¶
- Variables
- type Category
- type Client
- func (c *Client) Category() *Category
- func (c *Client) DoRequest(method, path string, params map[string]string, data interface{}) (*http.Response, error)
- func (c *Client) DoRequestWithBody(method, path string, params map[string]string, contentType string, ...) (*http.Response, error)
- func (c *Client) Metadata() *Metadata
- func (c *Client) Role() *Role
- func (c *Client) SDB() *SDB
- func (c *Client) Secret() *Secret
- func (c *Client) SecureFile() *SecureFile
- type Metadata
- type MetadataOpts
- type Role
- type SDB
- func (s *SDB) Create(newSDB *api.SafeDepositBox) (*api.SafeDepositBox, error)
- func (s *SDB) Delete(id string) error
- func (s *SDB) Get(id string) (*api.SafeDepositBox, error)
- func (s *SDB) GetByName(name string) (*api.SafeDepositBox, error)
- func (s *SDB) List() ([]*api.SafeDepositBox, error)
- func (s *SDB) Update(id string, updatedSDB *api.SafeDepositBox) (*api.SafeDepositBox, error)
- type Secret
- type SecureFile
Constants ¶
This section is empty.
Variables ¶
var ErrorBodyNotReturned = fmt.Errorf("No error body returned from server")
ErrorBodyNotReturned is an error indicating that the server did not return error details (in case of a non-successful status). This likely means that there is some sort of server error that is occurring
var ErrorSafeDepositBoxNotFound = fmt.Errorf("Unable to find Safe Deposit Box")
ErrorSafeDepositBoxNotFound is returned when a specified deposit box is not found
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct {
// contains filtered or unexported fields
}
Category is a subclient for accessing the category endpoint
type Client ¶
type Client struct { Authentication auth.Auth CerberusURL *url.URL // contains filtered or unexported fields }
Client is the main client for interacting with Cerberus
func NewClient ¶
NewClient creates a new Client given an Authentication method. This method expects a file (which can be nil) as a source for a OTP used for MFA against Cerberus (if needed). If it is a file, it expect the token and a new line.
func NewClientWithHeaders ¶
func (*Client) DoRequest ¶
func (c *Client) DoRequest(method, path string, params map[string]string, data interface{}) (*http.Response, error)
DoRequest is used to perform an HTTP request with the given method and path This method is what is called by other parts of the client and is exposed for advanced usage
func (*Client) DoRequestWithBody ¶ added in v0.4.0
func (c *Client) DoRequestWithBody(method, path string, params map[string]string, contentType string, body io.Reader) (*http.Response, error)
DoRequestWithBody executes a request with provided body
func (*Client) SecureFile ¶ added in v0.4.0
func (c *Client) SecureFile() *SecureFile
SecureFile returns the SecureFile client
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
Metadata is a subclient for accessing the metadata endpoint
func (*Metadata) List ¶
func (m *Metadata) List(opts MetadataOpts) (*api.MetadataResponse, error)
List returns a MetadataResponse which is a wrapper containing pagination data and an array of metadata objects
type MetadataOpts ¶
MetadataOpts is used for passing pagination values to the list function
type Role ¶
type Role struct {
// contains filtered or unexported fields
}
Role is a subclient for accessing the roles endpoint
type SDB ¶
type SDB struct {
// contains filtered or unexported fields
}
SDB is a client for managing and reading SafeDepositBox objects
func (*SDB) Create ¶
func (s *SDB) Create(newSDB *api.SafeDepositBox) (*api.SafeDepositBox, error)
Create creates a new Safe Deposit Box and returns the newly created object
func (*SDB) Get ¶
func (s *SDB) Get(id string) (*api.SafeDepositBox, error)
Get returns a single SDB given an ID. Returns ErrorSafeDepositBoxNotFound if the ID does not exist
func (*SDB) GetByName ¶
func (s *SDB) GetByName(name string) (*api.SafeDepositBox, error)
GetByName is a helper method that takes a SDB name and attempts to locate that box in a list of SDBs the client has access to
func (*SDB) List ¶
func (s *SDB) List() ([]*api.SafeDepositBox, error)
List returns a list of all SDBs the authenticated user is allowed to see
func (*SDB) Update ¶
func (s *SDB) Update(id string, updatedSDB *api.SafeDepositBox) (*api.SafeDepositBox, error)
Update updates an existing Safe Deposit Box. Any fields that are not null in the passed object will overwrite any fields on the current object
type Secret ¶
type Secret struct {
// contains filtered or unexported fields
}
Secret wraps the vault.Logical client to make sure all paths are prefaced with "secret". This does not expose Unwrap because it will not work with Cerberus' path routing
type SecureFile ¶ added in v0.4.0
type SecureFile struct {
// contains filtered or unexported fields
}
SecureFile is a subclient for secure files
func (*SecureFile) Get ¶ added in v0.4.0
func (r *SecureFile) Get(secureFilePath string, output io.Writer) error
Get downloads a secure file under localfile. File will be saved in output
func (*SecureFile) List ¶ added in v0.4.0
func (r *SecureFile) List(rootpath string) (*api.SecureFilesResponse, error)
List returns a list of secure files