hawkular / hawkular-client-go

Golang client for Hawkular
Apache License 2.0
6 stars 10 forks source link

support Basic auth #8

Closed jmazzitelli closed 8 years ago

jmazzitelli commented 8 years ago

in client.go I see this: if len(c.Token) > 0 { req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", c.Token))

This supports Bearer tokens. But no support for Basic auth.

We should add a "Username" and "Password" in the Parameters object. If they are specified, then add a "Basic" header. If they are not specified, but token is, then do what we are already doing (add a Bearer header). If neither are specified, do nothing.

jmazzitelli commented 8 years ago

this can be closed PR #9 addresses this