From 0f9316dbdfdf71cbbfd85c833e9e1eac66150eb2 Mon Sep 17 00:00:00 2001 From: Calvin Leung Huang Date: Fri, 30 Nov 2018 10:56:38 -0800 Subject: [PATCH 1/2] fetchACLTokenEntryAndEntity: set token entry on request if not cached --- vault/core.go | 2 -- vault/request_handling.go | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vault/core.go b/vault/core.go index 90cc8d5679149..f2e0a029f2a0f 100644 --- a/vault/core.go +++ b/vault/core.go @@ -1146,8 +1146,6 @@ func (c *Core) sealInitCommon(ctx context.Context, req *logical.Request) (retErr return retErr } - req.SetTokenEntry(te) - // Audit-log the request before going any further auth := &logical.Auth{ ClientToken: req.ClientToken, diff --git a/vault/request_handling.go b/vault/request_handling.go index eb43266607833..ab19a0c1245df 100644 --- a/vault/request_handling.go +++ b/vault/request_handling.go @@ -136,6 +136,8 @@ func (c *Core) fetchACLTokenEntryAndEntity(ctx context.Context, req *logical.Req c.logger.Error("failed to lookup token", "error", err) return nil, nil, nil, nil, ErrInternalError } + // Set the token entry here since it has not been cached yet + req.SetTokenEntry(te) default: te = req.TokenEntry() } From 09bb133d90dab7bb78da4fe099a52e474fa09f8d Mon Sep 17 00:00:00 2001 From: Calvin Leung Huang Date: Fri, 30 Nov 2018 10:57:47 -0800 Subject: [PATCH 2/2] command/test: do not run TestSealMigration on ent --- command/seal_migration_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/command/seal_migration_test.go b/command/seal_migration_test.go index 67c3d46e463a2..a744fa45d67c8 100644 --- a/command/seal_migration_test.go +++ b/command/seal_migration_test.go @@ -1,3 +1,5 @@ +// +build !enterprise + package command import (