mirror of https://github.com/status-im/consul.git
acl: fix bug in 'consul members' filtering with partitions (#11263)
This commit is contained in:
parent
585f78f35a
commit
0c94095dfd
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
acl: **(Enterprise only)** Fix bug in 'consul members' filtering with partitions.
|
||||
```
|
|
@ -150,11 +150,11 @@ func (a *Agent) filterMembers(token string, members *[]serf.Member) error {
|
|||
}
|
||||
|
||||
var authzContext acl.AuthorizerContext
|
||||
a.agentEnterpriseMeta().FillAuthzContext(&authzContext)
|
||||
// Filter out members based on the node policy.
|
||||
m := *members
|
||||
for i := 0; i < len(m); i++ {
|
||||
node := m[i].Name
|
||||
serfMemberFillAuthzContext(&m[i], &authzContext)
|
||||
if authz.NodeRead(node, &authzContext) == acl.Allow {
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
// +build !consulent
|
||||
|
||||
package agent
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/serf/serf"
|
||||
|
||||
"github.com/hashicorp/consul/acl"
|
||||
)
|
||||
|
||||
func serfMemberFillAuthzContext(m *serf.Member, ctx *acl.AuthorizerContext) {
|
||||
// no-op
|
||||
}
|
Loading…
Reference in New Issue