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:
Dhia Ayachi 2021-09-13 16:53:09 -04:00 committed by GitHub
parent b4d5860197
commit ad914e16c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 4 deletions

View File

@ -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)