mirror of https://github.com/status-im/consul.git
acl-tokens table partitioning (#11020)
* convert `Policies` index to use `indexerMulti` * remove non used indexer * fix oss policy Get * add oss tests * remove reference to partition in oss test * convert `Roles` index to use `indexerMulti` * add role test in oss * fix oss to use the right index func * convert `Roles` index to use `indexerSingle` * split authmethod write indexer to oss and ent * add auth method unit tests * add index locality * move intFromBool to be available for oss * add expiry indexes * add api tests * fix rebase * use Bool func * preallocate slice * rename variable
This commit is contained in:
parent
b4d5860197
commit
ad914e16c2
|
@ -234,12 +234,20 @@ func TestAPI_ACLPolicy_List(t *testing.T) {
|
|||
}
|
||||
|
||||
func prepTokenPolicies(t *testing.T, acl *ACL) (policies []*ACLPolicy) {
|
||||
return prepTokenPoliciesInPartition(t, acl, "")
|
||||
}
|
||||
|
||||
func prepTokenPoliciesInPartition(t *testing.T, acl *ACL, partition string) (policies []*ACLPolicy) {
|
||||
var wqPart *WriteOptions
|
||||
if partition != "" {
|
||||
wqPart = &WriteOptions{Partition: partition}
|
||||
}
|
||||
policy, _, err := acl.PolicyCreate(&ACLPolicy{
|
||||
Name: "one",
|
||||
Description: "one description",
|
||||
Rules: `acl = "read"`,
|
||||
Datacenters: []string{"dc1", "dc2"},
|
||||
}, nil)
|
||||
}, wqPart)
|
||||
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, policy)
|
||||
|
@ -250,7 +258,7 @@ func prepTokenPolicies(t *testing.T, acl *ACL) (policies []*ACLPolicy) {
|
|||
Description: "two description",
|
||||
Rules: `node_prefix "" { policy = "read" }`,
|
||||
Datacenters: []string{"dc1", "dc2"},
|
||||
}, nil)
|
||||
}, wqPart)
|
||||
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, policy)
|
||||
|
@ -260,7 +268,7 @@ func prepTokenPolicies(t *testing.T, acl *ACL) (policies []*ACLPolicy) {
|
|||
Name: "three",
|
||||
Description: "three description",
|
||||
Rules: `service_prefix "" { policy = "read" }`,
|
||||
}, nil)
|
||||
}, wqPart)
|
||||
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, policy)
|
||||
|
@ -270,7 +278,7 @@ func prepTokenPolicies(t *testing.T, acl *ACL) (policies []*ACLPolicy) {
|
|||
Name: "four",
|
||||
Description: "four description",
|
||||
Rules: `agent "foo" { policy = "write" }`,
|
||||
}, nil)
|
||||
}, wqPart)
|
||||
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, policy)
|
||||
|
|
Loading…
Reference in New Issue