mirror of
https://github.com/hashicorp/vault.git
synced 2026-01-08 10:11:29 +01:00
Move helper funcs out of tests to fix build errors (#28877)
* Move helper funcs out of tests to fix build errors * Rename identiy->identity
This commit is contained in:
parent
1aa9a7a138
commit
d77ddc41b5
@ -1600,27 +1600,6 @@ func TestEntityStoreLoadingIsDeterministic(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func makeEntityForPacker(t *testing.T, id string, p *storagepacker.StoragePacker) *identity.Entity {
|
||||
return &identity.Entity{
|
||||
ID: id,
|
||||
Name: id,
|
||||
NamespaceID: namespace.RootNamespaceID,
|
||||
BucketKey: p.BucketKey(id),
|
||||
}
|
||||
}
|
||||
|
||||
func attachAlias(t *testing.T, e *identity.Entity, name string, me *MountEntry) *identity.Alias {
|
||||
a := &identity.Alias{
|
||||
ID: name,
|
||||
Name: name,
|
||||
CanonicalID: e.ID,
|
||||
MountType: me.Type,
|
||||
MountAccessor: me.Accessor,
|
||||
}
|
||||
e.UpsertAlias(a)
|
||||
return a
|
||||
}
|
||||
|
||||
func makeGroupWithIDAndAlias(t *testing.T, id, alias, bucketKey string, me *MountEntry) *identity.Group {
|
||||
g := &identity.Group{
|
||||
ID: id,
|
||||
|
||||
@ -9,6 +9,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
metrics "github.com/armon/go-metrics"
|
||||
@ -2628,3 +2629,25 @@ func (i *IdentityStore) countEntitiesByMountAccessor(ctx context.Context) (map[s
|
||||
|
||||
return byMountAccessor, nil
|
||||
}
|
||||
|
||||
func makeEntityForPacker(_t *testing.T, id string, p *storagepacker.StoragePacker) *identity.Entity {
|
||||
return &identity.Entity{
|
||||
ID: id,
|
||||
Name: id,
|
||||
NamespaceID: namespace.RootNamespaceID,
|
||||
BucketKey: p.BucketKey(id),
|
||||
}
|
||||
}
|
||||
|
||||
func attachAlias(t *testing.T, e *identity.Entity, name string, me *MountEntry) *identity.Alias {
|
||||
t.Helper()
|
||||
a := &identity.Alias{
|
||||
ID: name,
|
||||
Name: name,
|
||||
CanonicalID: e.ID,
|
||||
MountType: me.Type,
|
||||
MountAccessor: me.Accessor,
|
||||
}
|
||||
e.UpsertAlias(a)
|
||||
return a
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user