Moves the coordinate fetch after the ACL check.
This commit is contained in:
parent
dac4367fb2
commit
77ab587ae1
|
@ -35,14 +35,6 @@ func (s *HTTPServer) AgentSelf(resp http.ResponseWriter, req *http.Request) (int
|
||||||
return nil, MethodNotAllowedError{req.Method, []string{"GET"}}
|
return nil, MethodNotAllowedError{req.Method, []string{"GET"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
var cs lib.CoordinateSet
|
|
||||||
if !s.agent.config.DisableCoordinates {
|
|
||||||
var err error
|
|
||||||
if cs, err = s.agent.GetLANCoordinate(); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch the ACL token, if any, and enforce agent policy.
|
// Fetch the ACL token, if any, and enforce agent policy.
|
||||||
var token string
|
var token string
|
||||||
s.parseToken(req, &token)
|
s.parseToken(req, &token)
|
||||||
|
@ -54,6 +46,14 @@ func (s *HTTPServer) AgentSelf(resp http.ResponseWriter, req *http.Request) (int
|
||||||
return nil, acl.ErrPermissionDenied
|
return nil, acl.ErrPermissionDenied
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var cs lib.CoordinateSet
|
||||||
|
if !s.agent.config.DisableCoordinates {
|
||||||
|
var err error
|
||||||
|
if cs, err = s.agent.GetLANCoordinate(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
config := struct {
|
config := struct {
|
||||||
Datacenter string
|
Datacenter string
|
||||||
NodeName string
|
NodeName string
|
||||||
|
|
Loading…
Reference in New Issue