MCPcopy
hub / github.com/hashicorp/vault / parseConfig

Method parseConfig

command/server.go:434–465  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

432}
433
434func (c *ServerCommand) parseConfig() (*server.Config, []configutil.ConfigError, error) {
435 var configErrors []configutil.ConfigError
436 // Load the configuration
437 var config *server.Config
438 for _, path := range c.flagConfigs {
439 // TODO (HCL_DUP_KEYS_DEPRECATION): return to server.LoadConfig once deprecation is done
440 current, duplicate, err := server.LoadConfigCheckDuplicate(path)
441 if err != nil {
442 return nil, nil, fmt.Errorf("error loading configuration from %s: %w", path, err)
443 }
444 if duplicate {
445 c.UI.Warn(fmt.Sprintf(
446 "WARNING: Duplicate keys found in the Vault server configuration file %q, duplicate keys in HCL files are deprecated and will be forbidden in a future release.", path))
447 }
448
449 configErrors = append(configErrors, current.Validate(path)...)
450
451 if config == nil {
452 config = current
453 } else {
454 config = config.Merge(current)
455 }
456 }
457
458 if config != nil && config.Entropy != nil && config.Entropy.Mode == configutil.EntropyAugmentation && constants.IsFIPS() {
459 c.UI.Warn("WARNING: Entropy Augmentation is not supported in FIPS 140-3 Inside mode; disabling from server configuration!\n")
460 config.Entropy = nil
461 }
462 entCheckRequestLimiter(c, config)
463
464 return config, configErrors, nil
465}
466
467func (c *ServerCommand) runRecoveryMode() int {
468 config, configErrors, err := c.parseConfig()

Callers 3

runRecoveryModeMethod · 0.95
RunMethod · 0.95
offlineDiagnosticsMethod · 0.95

Calls 6

MergeMethod · 0.95
LoadConfigCheckDuplicateFunction · 0.92
IsFIPSFunction · 0.92
entCheckRequestLimiterFunction · 0.85
WarnMethod · 0.65
ValidateMethod · 0.65

Tested by

no test coverage detected