move unused GetCoreConfigInternal to common file to prevent ent panics (#16165)

This commit is contained in:
Hridoy Roy 2022-06-27 14:41:56 -07:00 committed by GitHub
parent 3bc56cfcca
commit 895e422c4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -7,7 +7,6 @@ import (
"fmt"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/command/server"
"github.com/hashicorp/vault/helper/namespace"
"github.com/hashicorp/vault/sdk/helper/license"
"github.com/hashicorp/vault/sdk/logical"
@ -71,16 +70,6 @@ func (c *Core) barrierViewForNamespace(namespaceId string) (*BarrierView, error)
return c.systemBarrierView, nil
}
// GetCoreConfigInternal returns the server configuration
// in struct format.
func (c *Core) GetCoreConfigInternal() *server.Config {
conf := c.rawConfig.Load()
if conf == nil {
return nil
}
return conf.(*server.Config)
}
func (c *Core) teardownReplicationResolverHandler() {}
func createSecondaries(*Core, *CoreConfig) {}

View File

@ -4,9 +4,20 @@ import (
"context"
uuid "github.com/hashicorp/go-uuid"
"github.com/hashicorp/vault/command/server"
"github.com/hashicorp/vault/sdk/logical"
)
// GetCoreConfigInternal returns the server configuration
// in struct format.
func (c *Core) GetCoreConfigInternal() *server.Config {
conf := c.rawConfig.Load()
if conf == nil {
return nil
}
return conf.(*server.Config)
}
func (c *Core) loadHeaderHMACKey(ctx context.Context) error {
ent, err := c.barrier.Get(ctx, indexHeaderHMACKeyPath)
if err != nil {