Removing a leftover helper function from before we changed how we configured the client.
This commit is contained in:
parent
3c1c1f79b8
commit
256ec2ea47
1 changed files with 3 additions and 10 deletions
13
realis.go
13
realis.go
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue