Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #51 from nandlabs/fix/todocleanup
Browse files Browse the repository at this point in the history
#49 Updated TODO and func doco
  • Loading branch information
nandagopalan authored Dec 28, 2022
2 parents 659359d + c4d625f commit 15ef05d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion clients/rest/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const (
)

// Request struct holds the http Request for the rest client
// TODO Add multipart implementation
type Request struct {
url string
method string
Expand Down
6 changes: 5 additions & 1 deletion clients/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (
proxyAuthHdr = "Proxy-Authorization"
)

// TODO Add certificate
//Client Object
type Client struct {
retryInfo *clients.RetryInfo
circuitBreaker *clients.CircuitBreaker
Expand Down Expand Up @@ -127,6 +127,8 @@ func (c *Client) SetProxy(proxyUrl, user, password string) (err error) {
return
}

//SetCACerts can take a list of caFilePaths and will add it as the x509 CertPool to the *tls.Config.RootCAs
//The Order of addition is same as the order as they are presented in the paramter
func (c *Client) SetCACerts(caFilePath ...string) (*Client, error) {
conf, err := c.setTlSConfig()
if err != nil {
Expand All @@ -146,6 +148,7 @@ func (c *Client) SetCACerts(caFilePath ...string) (*Client, error) {
return c, nil
}

//SetTLSCerts will set a list of client certificate ket pair.
func (c *Client) SetTLSCerts(certs ...tls.Certificate) (*Client, error) {
conf, err := c.setTlSConfig()
if err != nil {
Expand All @@ -167,6 +170,7 @@ func (c *Client) setSSL(conf *tls.Config) {
c.httpTransport = transport
}

//UseEnvProxy will ensure that the proxy settings are loaded using ENV parameters.
func (c *Client) UseEnvProxy(urlParam, userParam, passwdParam string) (err error) {
u := config.GetEnvAsString(urlParam, textutils.EmptyStr)
user := config.GetEnvAsString(userParam, textutils.EmptyStr)
Expand Down

0 comments on commit 15ef05d

Please sign in to comment.