mirror of https://github.com/status-im/consul.git
Set enterprise metadata after resolving the token (#8302)
The token can encode enterprise metadata information, and we must make sure we set that on the reply so that we can correct filter ACLs.
This commit is contained in:
parent
8b5bed1efc
commit
4d857d117f
|
@ -296,8 +296,6 @@ func (c *Catalog) ListServices(args *structs.DCSpecificRequest, reply *structs.I
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
reply.EnterpriseMeta = args.EnterpriseMeta
|
|
||||||
|
|
||||||
authz, err := c.srv.ResolveTokenAndDefaultMeta(args.Token, &args.EnterpriseMeta, nil)
|
authz, err := c.srv.ResolveTokenAndDefaultMeta(args.Token, &args.EnterpriseMeta, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -307,6 +305,10 @@ func (c *Catalog) ListServices(args *structs.DCSpecificRequest, reply *structs.I
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set reply enterprise metadata after resolving and validating the token so
|
||||||
|
// that we can properly infer metadata from the token.
|
||||||
|
reply.EnterpriseMeta = args.EnterpriseMeta
|
||||||
|
|
||||||
return c.srv.blockingQuery(
|
return c.srv.blockingQuery(
|
||||||
&args.QueryOptions,
|
&args.QueryOptions,
|
||||||
&reply.QueryMeta,
|
&reply.QueryMeta,
|
||||||
|
|
Loading…
Reference in New Issue