mirror of
https://github.com/status-im/consul.git
synced 2025-02-02 00:46:43 +00:00
acl: fix bug in 'consul members' filtering with partitions (#11263)
This commit is contained in:
parent
585f78f35a
commit
0c94095dfd
3
.changelog/11263.txt
Normal file
3
.changelog/11263.txt
Normal file
@ -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
|
||||
}
|
||||
|
13
agent/acl_oss.go
Normal file
13
agent/acl_oss.go
Normal file
@ -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…
x
Reference in New Issue
Block a user