Use JWT in enterprise for authentication
parent
5b3f32cbfd
commit
adaf11f26d
|
@ -11,6 +11,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/bouk/httprouter"
|
"github.com/bouk/httprouter"
|
||||||
|
"github.com/influxdata/chronograf/influx"
|
||||||
"github.com/influxdata/flux/ast"
|
"github.com/influxdata/flux/ast"
|
||||||
_ "github.com/influxdata/flux/builtin"
|
_ "github.com/influxdata/flux/builtin"
|
||||||
"github.com/influxdata/flux/complete"
|
"github.com/influxdata/flux/complete"
|
||||||
|
@ -174,11 +175,9 @@ func (s *Service) ProxyFlux(w http.ResponseWriter, r *http.Request) {
|
||||||
req.Host = u.Host
|
req.Host = u.Host
|
||||||
req.URL = u
|
req.URL = u
|
||||||
|
|
||||||
// Because we are acting as a proxy, flux needs to have the basic auth information set as
|
// Use authorization method based on whether it is OSS or Enterprise
|
||||||
// a header directly
|
auth := influx.DefaultAuthorization(&src)
|
||||||
if src.Username != "" && src.Password != "" {
|
auth.Set(req)
|
||||||
req.SetBasicAuth(src.Username, src.Password)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: this was copied from services we may not needs this?
|
// TODO: this was copied from services we may not needs this?
|
||||||
|
|
Loading…
Reference in New Issue