Skip to content

Commit

Permalink
Fix ent bug caused by #17241.
Browse files Browse the repository at this point in the history
All tests passed in OSS, but not ENT. This is a patch to resolve
the problem for both.
  • Loading branch information
hashi-derek committed May 9, 2023
1 parent 48f7d99 commit ec7a800
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 @@ -214,6 +214,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 @@ -239,14 +247,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 ec7a800

Please sign in to comment.