From 41deb88d684d86ed74a7943a607b2a9c93076e80 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Tue, 23 Oct 2018 15:03:17 -0400 Subject: [PATCH] Add disable-indexing --- command/server.go | 1 + command/server/config.go | 14 ++++++++++++++ vault/core.go | 2 ++ 3 files changed, 17 insertions(+) diff --git a/command/server.go b/command/server.go index c1c4450d5b..bd4e47ba65 100644 --- a/command/server.go +++ b/command/server.go @@ -528,6 +528,7 @@ func (c *ServerCommand) Run(args []string) int { EnableRaw: config.EnableRawEndpoint, DisableSealWrap: config.DisableSealWrap, DisablePerformanceStandby: config.DisablePerformanceStandby, + DisableIndexing: config.DisableIndexing, AllLoggers: allLoggers, } if c.flagDev { diff --git a/command/server/config.go b/command/server/config.go index 8a1f1f5165..0943b926d3 100644 --- a/command/server/config.go +++ b/command/server/config.go @@ -69,6 +69,9 @@ type Config struct { DisableSealWrap bool `hcl:"-"` DisableSealWrapRaw interface{} `hcl:"disable_sealwrap"` + + DisableIndexing bool `hcl:"-"` + DisableIndexing interface{} `hcl:"disable_indexing"` } // DevConfig is a Config that is used for dev mode of Vault. @@ -347,6 +350,11 @@ func (c *Config) Merge(c2 *Config) *Config { result.DisableSealWrap = c2.DisableSealWrap } + result.DisableIndexing = c.DisableIndexing + if c2.DisableIndexing { + result.DisableIndexing = c2.DisableIndexing + } + return result } @@ -452,6 +460,12 @@ func ParseConfig(d string, logger log.Logger) (*Config, error) { } } + if result.DisableIndexing != nil { + if result.DisableIndexing, err = parseutil.ParseBool(result.DisableIndexing); err != nil { + return nil, err + } + } + list, ok := obj.Node.(*ast.ObjectList) if !ok { return nil, fmt.Errorf("error parsing: file doesn't contain a root object") diff --git a/vault/core.go b/vault/core.go index ff2416c1bf..ed27f54df9 100644 --- a/vault/core.go +++ b/vault/core.go @@ -459,6 +459,7 @@ type CoreConfig struct { DevLicenseDuration time.Duration DisablePerformanceStandby bool + DisableIndexing bool AllLoggers []log.Logger } @@ -491,6 +492,7 @@ func (c *CoreConfig) Clone() *CoreConfig { LicensingConfig: c.LicensingConfig, DevLicenseDuration: c.DevLicenseDuration, DisablePerformanceStandby: c.DisablePerformanceStandby, + DisableIndexing: c.DisableIndexing, AllLoggers: c.AllLoggers, } }