Removing a leftover helper function from before we changed how we configured the client.

This commit is contained in:
Renan DelValle 2018-04-10 14:19:10 -07:00
parent 3c1c1f79b8
commit 256ec2ea47
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9

View file

@ -284,9 +284,10 @@ func NewRealisClient(options ...ClientOption) (Realis, error) {
config.infoLogger.Printf("gorealis config url: %+v\n", url)
//Basic Authentication.
// Adding Basic Authentication.
if config.username != "" && config.password != "" {
AddBasicAuth(config, config.username, config.password)
httpTrans := (config.transport).(*thrift.THttpClient)
httpTrans.SetHeader("Authorization", "Basic "+basicAuth(config.username, config.password))
}
return &realisClient{
@ -416,14 +417,6 @@ func newTBinaryConfig(url string, timeoutms int, config *RealisConfig) (*RealisC
}
// Helper function to add basic authorization needed to communicate with Apache Aurora.
func AddBasicAuth(config *RealisConfig, username string, password string) {
config.username = username
config.password = password
httpTrans := (config.transport).(*thrift.THttpClient)
httpTrans.SetHeader("Authorization", "Basic "+basicAuth(username, password))
}
func basicAuth(username, password string) string {
auth := username + ":" + password
return base64.StdEncoding.EncodeToString([]byte(auth))