ocket8888 commented on a change in pull request #3932: Rewrote 
/user/login/token to Go
URL: https://github.com/apache/trafficcontrol/pull/3932#discussion_r327203711
 
 

 ##########
 File path: traffic_ops/client/session.go
 ##########
 @@ -207,6 +244,36 @@ func LoginWithAgent(toURL string, toUser string, toPasswd 
string, insecure bool,
        return to, remoteAddr, nil
 }
 
+func LoginWithToken(toURL string, token string, insecure bool, userAgent 
string, useCache bool, requestTimeout time.Duration) (*Session, net.Addr, 
error) {
+       options := cookiejar.Options {
+               PublicSuffixList: publicsuffix.List,
+       }
+
+       jar, err := cookiejar.New(&options)
+       if err != nil {
+               return nil, nil, err
+       }
+
+       client := http.Client {
+               Timeout: requestTimeout,
+               Transport: &http.Transport {
+                       TLSClientConfig: &tls.Config{InsecureSkipVerify: 
insecure},
 
 Review comment:
   no, that's based on the value of the parameter given by the caller. So each 
program that uses the client provides the choice of whether or not to skip cert 
verification.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to