Skip to content

Commit

Permalink
Merge ec7a800 into backport/derekm/NET-3881/health-call-loop-entfix/s…
Browse files Browse the repository at this point in the history
…upposedly-sure-garfish
  • Loading branch information
hc-github-team-consul-core committed May 9, 2023
2 parents e4b28e4 + ec7a800 commit 4dd293e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions agent/consul/health_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,14 @@ func (h *Health) ServiceNodes(args *structs.ServiceSpecificRequest, reply *struc
f = h.serviceNodesDefault
}

authzContext := acl.AuthorizerContext{
Peer: args.PeerName,
}
authz, err := h.srv.ResolveTokenAndDefaultMeta(args.Token, &args.EnterpriseMeta, &authzContext)
if err != nil {
return err
}

if err := h.srv.validateEnterpriseRequest(&args.EnterpriseMeta, false); err != nil {
return err
}
Expand All @@ -236,14 +244,6 @@ func (h *Health) ServiceNodes(args *structs.ServiceSpecificRequest, reply *struc
return err
}

authzContext := acl.AuthorizerContext{
Peer: args.PeerName,
}
authz, err := h.srv.ResolveTokenAndDefaultMeta(args.Token, &args.EnterpriseMeta, &authzContext)
if err != nil {
return err
}

// If we're doing a connect or ingress query, we need read access to the service
// we're trying to find proxies for, so check that.
if args.Connect || args.Ingress {
Expand Down

0 comments on commit 4dd293e

Please sign in to comment.