diff --git a/vault/identity_store_test.go b/vault/identity_store_test.go index ed3b1208a6..cce4da413c 100644 --- a/vault/identity_store_test.go +++ b/vault/identity_store_test.go @@ -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, diff --git a/vault/identiy_store_test_stubs_oss.go b/vault/identity_store_test_stubs_oss.go similarity index 100% rename from vault/identiy_store_test_stubs_oss.go rename to vault/identity_store_test_stubs_oss.go diff --git a/vault/identity_store_util.go b/vault/identity_store_util.go index b3a6d47748..67d27aa829 100644 --- a/vault/identity_store_util.go +++ b/vault/identity_store_util.go @@ -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 +}