Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct { Username string `yaml:",omitempty"` Password string `yaml:",omitempty"` Token string `yaml:",omitempty"` }
Credentials provides information when needing to authenticate to remote endpoints. Credentials are either a username/password or a bearer token, but not both.
func (*Credentials) GetHTTPAuthHeader ¶
func (c *Credentials) GetHTTPAuthHeader() (headerName string, headerValue string, err error)
GetHTTPAuthHeader provides the authentication ehader name and value (can be empty), or an error
func (*Credentials) ValidateCredentials ¶
func (c *Credentials) ValidateCredentials() error
ValidateCredentials makes sure that if username is provided, so is password (and vice versa) and also makes sure if username/password is provided that token is not (and vice versa). It is valid to have nothing defined (no username, password, nor token).
Click to show internal directories.
Click to hide internal directories.