From d1f86a376c518b5761b325d1f8d9558134e7c5dc Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Sun, 26 Aug 2018 10:53:11 -0400 Subject: [PATCH] Properly persist alias metadata In addition, don't lie about what's actually being stored --- vault/identity_store.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vault/identity_store.go b/vault/identity_store.go index 13b17983e617..afd782964287 100644 --- a/vault/identity_store.go +++ b/vault/identity_store.go @@ -360,8 +360,6 @@ func (i *IdentityStore) CreateOrFetchEntity(alias *logical.Alias) (*identity.Ent return entity, nil } - i.logger.Debug("creating a new entity", "alias", alias) - entity = &identity.Entity{} err = i.sanitizeEntity(entity) @@ -374,6 +372,7 @@ func (i *IdentityStore) CreateOrFetchEntity(alias *logical.Alias) (*identity.Ent CanonicalID: entity.ID, Name: alias.Name, MountAccessor: alias.MountAccessor, + Metadata: alias.Metadata, MountPath: mountValidationResp.MountPath, MountType: mountValidationResp.MountType, } @@ -383,6 +382,8 @@ func (i *IdentityStore) CreateOrFetchEntity(alias *logical.Alias) (*identity.Ent return nil, err } + i.logger.Debug("creating a new entity", "alias", newAlias) + // Append the new alias to the new entity entity.Aliases = []*identity.Alias{ newAlias,