diff --git a/internal/cmd/commands/database/init.go b/internal/cmd/commands/database/init.go index 8664b5592..5c7e50254 100644 --- a/internal/cmd/commands/database/init.go +++ b/internal/cmd/commands/database/init.go @@ -5,19 +5,12 @@ import ( "fmt" "os" - "github.com/hashicorp/boundary/globals" "github.com/hashicorp/boundary/internal/cmd/base" "github.com/hashicorp/boundary/internal/cmd/config" "github.com/hashicorp/boundary/internal/errors" "github.com/hashicorp/boundary/internal/types/scope" - kms_plugin_assets "github.com/hashicorp/boundary/plugins/kms" - "github.com/hashicorp/boundary/sdk/wrapper" - "github.com/hashicorp/go-hclog" - wrapping "github.com/hashicorp/go-kms-wrapping/v2" - "github.com/hashicorp/go-secure-stdlib/configutil/v2" "github.com/hashicorp/go-secure-stdlib/mlock" "github.com/hashicorp/go-secure-stdlib/parseutil" - "github.com/hashicorp/go-secure-stdlib/pluginutil/v2" "github.com/mitchellh/cli" "github.com/posener/complete" ) @@ -41,7 +34,7 @@ type InitCommand struct { // deferred function on the Run method. configWrapperCleanupFunc func() error - flagConfig string + flagConfig []string flagConfigKms string flagLogLevel string flagLogFormat string @@ -87,7 +80,7 @@ func (c *InitCommand) Flags() *base.FlagSets { f := set.NewFlagSet("Command Options") - f.StringVar(&base.StringVar{ + f.StringSliceVar(&base.StringSliceVar{ Name: "config", Target: &c.flagConfig, Completion: complete.PredictOr( @@ -475,49 +468,7 @@ func (c *InitCommand) ParseFlagsAndConfig(args []string) int { return base.CommandUserError } - wrapperPath := c.flagConfig - if c.flagConfigKms != "" { - wrapperPath = c.flagConfigKms - } - wrapper, cleanupFunc, err := wrapper.GetWrapperFromPath( - c.Context, - wrapperPath, - globals.KmsPurposeConfig, - configutil.WithPluginOptions( - pluginutil.WithPluginsMap(kms_plugin_assets.BuiltinKmsPlugins()), - pluginutil.WithPluginsFilesystem(kms_plugin_assets.KmsPluginPrefix, kms_plugin_assets.FileSystem()), - ), - // TODO: How would we want to expose this kind of log to users when - // using recovery configs? Generally with normal CLI commands we - // don't print out all of these logs. We may want a logger with a - // custom writer behind our existing gate where we print nothing - // unless there is an error, then dump all of it. - configutil.WithLogger(hclog.NewNullLogger()), - ) - if err != nil { - c.UI.Error(err.Error()) - return base.CommandUserError - } - if wrapper != nil { - c.configWrapperCleanupFunc = cleanupFunc - if ifWrapper, ok := wrapper.(wrapping.InitFinalizer); ok { - if err := ifWrapper.Init(c.Context); err != nil && !errors.Is(err, wrapping.ErrFunctionNotImplemented) { - c.UI.Error(fmt.Errorf("Could not initialize kms: %w", err).Error()) - return base.CommandUserError - } - c.configWrapperCleanupFunc = func() error { - if err := ifWrapper.Finalize(context.Background()); err != nil && !errors.Is(err, wrapping.ErrFunctionNotImplemented) { - c.UI.Warn(fmt.Errorf("Could not finalize kms: %w", err).Error()) - } - if cleanupFunc != nil { - return cleanupFunc() - } - return nil - } - } - } - - c.Config, err = config.LoadFile(c.flagConfig, wrapper) + c.Config, err = config.Load(c.Context, c.flagConfig, c.flagConfigKms) if err != nil { c.UI.Error("Error parsing config: " + err.Error()) return base.CommandUserError diff --git a/internal/cmd/commands/database/migrate.go b/internal/cmd/commands/database/migrate.go index 3fbecc997..d56f18dc0 100644 --- a/internal/cmd/commands/database/migrate.go +++ b/internal/cmd/commands/database/migrate.go @@ -1,25 +1,18 @@ package database import ( - "context" "fmt" "os" "strconv" "strings" - "github.com/hashicorp/boundary/globals" "github.com/hashicorp/boundary/internal/cmd/base" "github.com/hashicorp/boundary/internal/cmd/config" "github.com/hashicorp/boundary/internal/db/schema" "github.com/hashicorp/boundary/internal/errors" "github.com/hashicorp/boundary/internal/observability/event" host_plugin_assets "github.com/hashicorp/boundary/plugins/host" - kms_plugin_assets "github.com/hashicorp/boundary/plugins/kms" external_host_plugins "github.com/hashicorp/boundary/sdk/plugins/host" - "github.com/hashicorp/boundary/sdk/wrapper" - "github.com/hashicorp/go-hclog" - wrapping "github.com/hashicorp/go-kms-wrapping/v2" - "github.com/hashicorp/go-secure-stdlib/configutil/v2" "github.com/hashicorp/go-secure-stdlib/mlock" "github.com/hashicorp/go-secure-stdlib/parseutil" "github.com/hashicorp/go-secure-stdlib/pluginutil/v2" @@ -49,7 +42,7 @@ type MigrateCommand struct { selectedRepairs schema.RepairMigrations - flagConfig string + flagConfig []string flagConfigKms string flagLogLevel string flagLogFormat string @@ -79,7 +72,7 @@ func (c *MigrateCommand) Flags() *base.FlagSets { f := set.NewFlagSet("Command options") - f.StringVar(&base.StringVar{ + f.StringSliceVar(&base.StringSliceVar{ Name: "config", Target: &c.flagConfig, Completion: complete.PredictOr( @@ -320,49 +313,7 @@ func (c *MigrateCommand) ParseFlagsAndConfig(args []string) int { return base.CommandUserError } - wrapperPath := c.flagConfig - if c.flagConfigKms != "" { - wrapperPath = c.flagConfigKms - } - wrapper, cleanupFunc, err := wrapper.GetWrapperFromPath( - c.Context, - wrapperPath, - globals.KmsPurposeConfig, - configutil.WithPluginOptions( - pluginutil.WithPluginsMap(kms_plugin_assets.BuiltinKmsPlugins()), - pluginutil.WithPluginsFilesystem(kms_plugin_assets.KmsPluginPrefix, kms_plugin_assets.FileSystem()), - ), - // TODO: How would we want to expose this kind of log to users when - // using recovery configs? Generally with normal CLI commands we - // don't print out all of these logs. We may want a logger with a - // custom writer behind our existing gate where we print nothing - // unless there is an error, then dump all of it. - configutil.WithLogger(hclog.NewNullLogger()), - ) - if err != nil { - c.UI.Error(err.Error()) - return base.CommandUserError - } - if wrapper != nil { - c.configWrapperCleanupFunc = cleanupFunc - if ifWrapper, ok := wrapper.(wrapping.InitFinalizer); ok { - if err := ifWrapper.Init(c.Context); err != nil && !errors.Is(err, wrapping.ErrFunctionNotImplemented) { - c.UI.Error(fmt.Errorf("Could not initialize kms: %w", err).Error()) - return base.CommandUserError - } - c.configWrapperCleanupFunc = func() error { - if err := ifWrapper.Finalize(context.Background()); err != nil && !errors.Is(err, wrapping.ErrFunctionNotImplemented) { - c.UI.Warn(fmt.Errorf("Could not finalize kms: %w", err).Error()) - } - if cleanupFunc != nil { - return cleanupFunc() - } - return nil - } - } - } - - c.Config, err = config.LoadFile(c.flagConfig, wrapper) + c.Config, err = config.Load(c.Context, c.flagConfig, c.flagConfigKms) if err != nil { c.UI.Error("Error parsing config: " + err.Error()) return base.CommandUserError diff --git a/internal/cmd/commands/server/server.go b/internal/cmd/commands/server/server.go index a05998808..cd0064f28 100644 --- a/internal/cmd/commands/server/server.go +++ b/internal/cmd/commands/server/server.go @@ -23,15 +23,10 @@ import ( "github.com/hashicorp/boundary/internal/errors" "github.com/hashicorp/boundary/internal/kms" "github.com/hashicorp/boundary/internal/observability/event" - kms_plugin_assets "github.com/hashicorp/boundary/plugins/kms" - "github.com/hashicorp/boundary/sdk/wrapper" "github.com/hashicorp/go-hclog" - wrapping "github.com/hashicorp/go-kms-wrapping/v2" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/go-secure-stdlib/configutil/v2" "github.com/hashicorp/go-secure-stdlib/mlock" "github.com/hashicorp/go-secure-stdlib/parseutil" - "github.com/hashicorp/go-secure-stdlib/pluginutil/v2" "github.com/hashicorp/go-uuid" "github.com/mitchellh/cli" "github.com/posener/complete" @@ -56,7 +51,7 @@ type Command struct { controller *controller.Controller worker *worker.Worker - flagConfig string + flagConfig []string flagConfigKms string flagLogLevel string flagLogFormat string @@ -90,14 +85,14 @@ func (c *Command) Flags() *base.FlagSets { f := set.NewFlagSet("Command Options") - f.StringVar(&base.StringVar{ + f.StringSliceVar(&base.StringSliceVar{ Name: "config", Target: &c.flagConfig, Completion: complete.PredictOr( complete.PredictFiles("*.hcl"), complete.PredictFiles("*.json"), ), - Usage: "Path to the configuration file.", + Usage: "Path to the configuration file. Can be specified multiple times for multiple configuration files (only if using HCL format).", }) f.StringVar(&base.StringVar{ @@ -548,63 +543,17 @@ func (c *Command) reloadConfig() (*config.Config, int) { switch { case c.presetConfig != nil: cfg, err = config.Parse(c.presetConfig.Load()) + if err != nil { + event.WriteError(c.Context, op, err, event.WithInfoMsg("could not parse presetConfig", "config", c.presetConfig)) + return nil, base.CommandUserError + } default: - wrapperPath := c.flagConfig - if c.flagConfigKms != "" { - wrapperPath = c.flagConfigKms + cfg, err = config.Load(c.Context, c.flagConfig, c.flagConfigKms) + if err != nil { + c.UI.Error("Error parsing config: " + err.Error()) + return nil, base.CommandUserError } - var configWrapper wrapping.Wrapper - var ifWrapper wrapping.InitFinalizer - var cleanupFunc func() error - if wrapperPath != "" { - configWrapper, cleanupFunc, err = wrapper.GetWrapperFromPath( - c.Context, - wrapperPath, - globals.KmsPurposeConfig, - configutil.WithPluginOptions( - pluginutil.WithPluginsMap(kms_plugin_assets.BuiltinKmsPlugins()), - pluginutil.WithPluginsFilesystem(kms_plugin_assets.KmsPluginPrefix, kms_plugin_assets.FileSystem()), - ), - // TODO: How would we want to expose this kind of log to users when - // using recovery configs? Generally with normal CLI commands we - // don't print out all of these logs. We may want a logger with a - // custom writer behind our existing gate where we print nothing - // unless there is an error, then dump all of it. - configutil.WithLogger(hclog.NewNullLogger()), - ) - if err != nil { - event.WriteError(c.Context, op, err, event.WithInfoMsg("could not get kms wrapper from config", "path", c.flagConfig)) - return nil, base.CommandUserError - } - if cleanupFunc != nil { - defer func() { - if err := cleanupFunc(); err != nil { - event.WriteError(c.Context, op, err, event.WithInfoMsg("could not clean up kms wrapper", "path", c.flagConfig)) - } - }() - } - if configWrapper != nil { - ifWrapper, _ = configWrapper.(wrapping.InitFinalizer) - } - } - if ifWrapper != nil { - if err := ifWrapper.Init(c.Context); err != nil && !errors.Is(err, wrapping.ErrFunctionNotImplemented) { - event.WriteError(c.Context, op, err, event.WithInfoMsg("could not initialize kms", "path", c.flagConfig)) - return nil, base.CommandCliError - } - } - cfg, err = config.LoadFile(c.flagConfig, configWrapper) - if ifWrapper != nil { - if err := ifWrapper.Finalize(context.Background()); err != nil && !errors.Is(err, wrapping.ErrFunctionNotImplemented) { - event.WriteError(context.Background(), op, err, event.WithInfoMsg("could not finalize kms", "path", c.flagConfig)) - return nil, base.CommandCliError - } - } - } - if err != nil { - event.WriteError(c.Context, op, err, event.WithInfoMsg("could not parse config", "path", c.flagConfig)) - return nil, base.CommandUserError } return cfg, 0 } @@ -754,7 +703,7 @@ func (c *Command) WaitForInterrupt() int { var newConf *config.Config var out int - if c.flagConfig == "" && c.presetConfig == nil { + if len(c.flagConfig) == 0 && c.presetConfig == nil { goto RUNRELOADFUNCS } diff --git a/internal/cmd/config/config.go b/internal/cmd/config/config.go index 244377f11..f5e503b24 100644 --- a/internal/cmd/config/config.go +++ b/internal/cmd/config/config.go @@ -2,25 +2,31 @@ package config import ( "bytes" + "context" "crypto/rand" "encoding/base64" "encoding/json" "errors" "fmt" "io" - "io/ioutil" "net" + "os" "reflect" "strconv" "strings" "time" + "github.com/hashicorp/boundary/globals" "github.com/hashicorp/boundary/internal/db" "github.com/hashicorp/boundary/internal/observability/event" + kms_plugin_assets "github.com/hashicorp/boundary/plugins/kms" + "github.com/hashicorp/boundary/sdk/wrapper" + "github.com/hashicorp/go-hclog" wrapping "github.com/hashicorp/go-kms-wrapping/v2" configutil "github.com/hashicorp/go-secure-stdlib/configutil/v2" "github.com/hashicorp/go-secure-stdlib/listenerutil" "github.com/hashicorp/go-secure-stdlib/parseutil" + "github.com/hashicorp/go-secure-stdlib/pluginutil/v2" "github.com/hashicorp/go-secure-stdlib/strutil" "github.com/hashicorp/hcl" "github.com/hashicorp/hcl/hcl/ast" @@ -324,23 +330,100 @@ func New() *Config { } } -// LoadFile loads the configuration from the given file. -func LoadFile(path string, wrapper wrapping.Wrapper) (*Config, error) { - d, err := ioutil.ReadFile(path) - if err != nil { - return nil, err +// Load will create a Config from the given config files. It concatenates the +// contents of the files together. This allows for composing a config from +// separate files, but notably does not attempt any merging of configs. Thus it +// is possible that the concatenation results in an invalid config file. This +// also supports decrypting the config, either with a kms block in one of the +// given files, or as a separate file in wrapperPath. +// +// Note that having multiple config files is only supported properly if they are +// all hcl files. If they are json files, only the first file is used. A mix of +// hcl and json will result in an error. +func Load(ctx context.Context, paths []string, wrapperPath string) (*Config, error) { + const op = "config.Load" + + var err error + var cfg *Config + + configStrs := make([]string, 0, len(paths)) + for _, path := range paths { + fileBytes, err := os.ReadFile(path) + if err != nil { + event.WriteError(ctx, op, err, event.WithInfoMsg("could not read config file", "path", path, "error", err)) + return nil, err + } + configStrs = append(configStrs, string(fileBytes)) + } + configString := strings.Join(configStrs, "\n") + + wrapperString := configString + if wrapperPath != "" { + wrapperBytes, err := os.ReadFile(wrapperPath) + if err != nil { + event.WriteError(ctx, op, err, event.WithInfoMsg("could not read kms config file", "path", wrapperPath, "error", err)) + return nil, err + } + wrapperString = string(wrapperBytes) } - raw := string(d) + var configWrapper wrapping.Wrapper + var ifWrapper wrapping.InitFinalizer + var cleanupFunc func() error + if wrapperString != "" { + configWrapper, cleanupFunc, err = wrapper.GetWrapperFromHcl( + ctx, + wrapperString, + globals.KmsPurposeConfig, + configutil.WithPluginOptions( + pluginutil.WithPluginsMap(kms_plugin_assets.BuiltinKmsPlugins()), + pluginutil.WithPluginsFilesystem(kms_plugin_assets.KmsPluginPrefix, kms_plugin_assets.FileSystem()), + ), + // TODO: How would we want to expose this kind of log to users when + // using recovery configs? Generally with normal CLI commands we + // don't print out all of these logs. We may want a logger with a + // custom writer behind our existing gate where we print nothing + // unless there is an error, then dump all of it. + configutil.WithLogger(hclog.NewNullLogger()), + ) + if err != nil { + event.WriteError(ctx, op, err, event.WithInfoMsg("could not get kms wrapper from config", "path", wrapperPath)) + return nil, err + } + if cleanupFunc != nil { + defer func() { + if err := cleanupFunc(); err != nil { + event.WriteError(ctx, op, err, event.WithInfoMsg("could not clean up kms wrapper", "path", wrapperPath)) + } + }() + } + if configWrapper != nil { + ifWrapper, _ = configWrapper.(wrapping.InitFinalizer) + } + } + if ifWrapper != nil { + if err := ifWrapper.Init(ctx); err != nil && !errors.Is(err, wrapping.ErrFunctionNotImplemented) { + event.WriteError(ctx, op, err, event.WithInfoMsg("could not initialize kms", "path", wrapperPath)) + return nil, err + } + } - if wrapper != nil { - raw, err = configutil.EncryptDecrypt(raw, true, true, wrapper) + if configWrapper != nil { + configString, err = configutil.EncryptDecrypt(configString, true, true, configWrapper) if err != nil { return nil, err } } - return Parse(raw) + cfg, err = Parse(configString) + + if ifWrapper != nil { + if err := ifWrapper.Finalize(context.Background()); err != nil && !errors.Is(err, wrapping.ErrFunctionNotImplemented) { + event.WriteError(context.Background(), op, err, event.WithInfoMsg("could not finalize kms", "path", wrapperPath)) + return nil, err + } + } + return cfg, err } func Parse(d string) (*Config, error) { diff --git a/internal/cmd/config/config_load_test.go b/internal/cmd/config/config_load_test.go new file mode 100644 index 000000000..a5d7b9914 --- /dev/null +++ b/internal/cmd/config/config_load_test.go @@ -0,0 +1,1750 @@ +package config_test + +import ( + "context" + "fmt" + "io/ioutil" + "testing" + + "github.com/hashicorp/boundary/internal/cmd/config" + "github.com/hashicorp/boundary/internal/observability/event" + configutil "github.com/hashicorp/go-secure-stdlib/configutil/v2" + "github.com/hashicorp/go-secure-stdlib/listenerutil" + "github.com/stretchr/testify/require" +) + +func TestLoad(t *testing.T) { + cases := []struct { + name string + expected *config.Config + expectedErr error + }{ + { + "SingleFile", + &config.Config{ + SharedConfig: &configutil.SharedConfig{ + EntSharedConfig: configutil.EntSharedConfig{}, + Listeners: []*listenerutil.ListenerConfig{ + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "api", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"api"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: func() *bool { t := true; return &t }(), + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: []string{"*"}, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "cluster", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"cluster"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: nil, + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: nil, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "proxy", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"proxy"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: nil, + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: nil, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "ops", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"ops"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: nil, + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: nil, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + }, + Seals: []*configutil.KMS{ + { + Type: "aead", + Purpose: []string{"root"}, + Disabled: false, + PluginPath: "", + PluginChecksum: "", + PluginHashMethod: "", + Config: map[string]string{ + "aead_type": "aes-gcm", + "key": "sP1fnF5Xz85RrXyELHFeZg9Ad2qt4Z4bgNHVGtD6ung=", + "key_id": "global_root", + }, + }, + { + Type: "aead", + Purpose: []string{"worker-auth"}, + Disabled: false, + PluginPath: "", + PluginChecksum: "", + PluginHashMethod: "", + Config: map[string]string{ + "aead_type": "aes-gcm", + "key": "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=", + "key_id": "global_worker-auth", + }, + }, + { + Type: "aead", + Purpose: []string{"recovery"}, + Disabled: false, + PluginPath: "", + PluginChecksum: "", + PluginHashMethod: "", + Config: map[string]string{ + "aead_type": "aes-gcm", + "key": "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=", + "key_id": "global_recovery", + }, + }, + }, + Entropy: nil, + DisableMlock: true, + DisableMlockRaw: nil, + Telemetry: nil, + DefaultMaxRequestDuration: 0, + DefaultMaxRequestDurationRaw: nil, + LogFormat: "", + LogLevel: "", + PidFile: "", + ClusterName: "", + }, + Worker: &config.Worker{ + Name: "worker0", + Description: "A worker", + PublicAddr: "", + InitialUpstreams: []string{"boundary:9201"}, + InitialUpstreamsRaw: []interface{}{"boundary:9201"}, + ControllersRaw: nil, + Tags: nil, + TagsRaw: nil, + StatusGracePeriodDuration: 0, + AuthStoragePath: "", + ControllerGeneratedActivationToken: "", + }, + Controller: &config.Controller{ + Name: "controller0", + Description: "A controller", + Database: &config.Database{ + Url: "env://LOAD_TEST_BOUNDARY_POSTGRES_URL", + MigrationUrl: "", + MaxOpenConnections: 0, + MaxOpenConnectionsRaw: nil, + MaxIdleConnections: nil, + MaxIdleConnectionsRaw: nil, + ConnMaxIdleTime: nil, + ConnMaxIdleTimeDuration: nil, + SkipSharedLockAcquisition: false, + }, + PublicClusterAddr: "", + Scheduler: nil, + AuthTokenTimeToLive: nil, + AuthTokenTimeToLiveDuration: 0, + AuthTokenTimeToStale: nil, + AuthTokenTimeToStaleDuration: 0, + GracefulShutdownWait: nil, + GracefulShutdownWaitDuration: 0, + StatusGracePeriodDuration: 0, + }, + DevController: false, + DevUiPassthroughDir: "", + DevControllerKey: "", + DevWorkerAuthKey: "", + DevWorkerAuthStorageKey: "", + DevRecoveryKey: "", + Eventing: &event.EventerConfig{ + AuditEnabled: false, + ObservationsEnabled: true, + SysEventsEnabled: true, + Sinks: []*event.SinkConfig{ + { + Name: "default", + Description: "", + EventTypes: []event.Type{"*"}, + EventSourceUrl: "", + AllowFilters: nil, + DenyFilters: nil, + Format: event.JSONSinkFormat, + Type: event.StderrSink, + StderrConfig: nil, + FileConfig: nil, + WriterConfig: nil, + AuditConfig: &event.AuditConfig{ + FilterOverrides: map[event.DataClassification]event.FilterOperation{ + event.SecretClassification: event.RedactOperation, + event.SensitiveClassification: event.RedactOperation, + }, + FilterOverridesHCL: nil, + }, + }, + }, + }, + Plugins: config.Plugins{ + ExecutionDir: "", + }, + HcpbClusterId: "", + }, + nil, + }, + { + "MultiFile", + &config.Config{ + SharedConfig: &configutil.SharedConfig{ + EntSharedConfig: configutil.EntSharedConfig{}, + Listeners: []*listenerutil.ListenerConfig{ + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "api", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"api"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: func() *bool { t := true; return &t }(), + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: []string{"*"}, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "cluster", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"cluster"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: nil, + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: nil, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "ops", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"ops"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: nil, + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: nil, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "proxy", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"proxy"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: nil, + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: nil, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + }, + Seals: []*configutil.KMS{ + { + Type: "aead", + Purpose: []string{"root"}, + Disabled: false, + PluginPath: "", + PluginChecksum: "", + PluginHashMethod: "", + Config: map[string]string{ + "aead_type": "aes-gcm", + "key": "sP1fnF5Xz85RrXyELHFeZg9Ad2qt4Z4bgNHVGtD6ung=", + "key_id": "global_root", + }, + }, + { + Type: "aead", + Purpose: []string{"worker-auth"}, + Disabled: false, + PluginPath: "", + PluginChecksum: "", + PluginHashMethod: "", + Config: map[string]string{ + "aead_type": "aes-gcm", + "key": "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=", + "key_id": "global_worker-auth", + }, + }, + { + Type: "aead", + Purpose: []string{"recovery"}, + Disabled: false, + PluginPath: "", + PluginChecksum: "", + PluginHashMethod: "", + Config: map[string]string{ + "aead_type": "aes-gcm", + "key": "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=", + "key_id": "global_recovery", + }, + }, + }, + Entropy: nil, + DisableMlock: true, + DisableMlockRaw: nil, + Telemetry: nil, + DefaultMaxRequestDuration: 0, + DefaultMaxRequestDurationRaw: nil, + LogFormat: "", + LogLevel: "", + PidFile: "", + ClusterName: "", + }, + Worker: &config.Worker{ + Name: "worker0", + Description: "A worker", + PublicAddr: "", + InitialUpstreams: []string{"boundary:9201"}, + InitialUpstreamsRaw: []interface{}{"boundary:9201"}, + ControllersRaw: nil, + Tags: nil, + TagsRaw: nil, + StatusGracePeriodDuration: 0, + AuthStoragePath: "", + ControllerGeneratedActivationToken: "", + }, + Controller: &config.Controller{ + Name: "controller0", + Description: "A controller", + Database: &config.Database{ + Url: "env://LOAD_TEST_BOUNDARY_POSTGRES_URL", + MigrationUrl: "", + MaxOpenConnections: 0, + MaxOpenConnectionsRaw: nil, + MaxIdleConnections: nil, + MaxIdleConnectionsRaw: nil, + ConnMaxIdleTime: nil, + ConnMaxIdleTimeDuration: nil, + SkipSharedLockAcquisition: false, + }, + PublicClusterAddr: "", + Scheduler: nil, + AuthTokenTimeToLive: nil, + AuthTokenTimeToLiveDuration: 0, + AuthTokenTimeToStale: nil, + AuthTokenTimeToStaleDuration: 0, + GracefulShutdownWait: nil, + GracefulShutdownWaitDuration: 0, + StatusGracePeriodDuration: 0, + }, + DevController: false, + DevUiPassthroughDir: "", + DevControllerKey: "", + DevWorkerAuthKey: "", + DevWorkerAuthStorageKey: "", + DevRecoveryKey: "", + Eventing: &event.EventerConfig{ + AuditEnabled: false, + ObservationsEnabled: true, + SysEventsEnabled: true, + Sinks: []*event.SinkConfig{ + { + Name: "default", + Description: "", + EventTypes: []event.Type{"*"}, + EventSourceUrl: "", + AllowFilters: nil, + DenyFilters: nil, + Format: event.JSONSinkFormat, + Type: event.StderrSink, + StderrConfig: nil, + FileConfig: nil, + WriterConfig: nil, + AuditConfig: &event.AuditConfig{ + FilterOverrides: map[event.DataClassification]event.FilterOperation{ + event.SecretClassification: event.RedactOperation, + event.SensitiveClassification: event.RedactOperation, + }, + FilterOverridesHCL: nil, + }, + }, + }, + }, + Plugins: config.Plugins{ + ExecutionDir: "", + }, + HcpbClusterId: "", + }, + nil, + }, + { + "MultiFileDuplicateStanza", + &config.Config{ + SharedConfig: &configutil.SharedConfig{ + EntSharedConfig: configutil.EntSharedConfig{}, + Listeners: []*listenerutil.ListenerConfig{ + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "api", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"api"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: func() *bool { t := true; return &t }(), + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: []string{"*"}, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "cluster", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"cluster"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: nil, + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: nil, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "ops", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"ops"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: nil, + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: nil, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "proxy", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"proxy"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: nil, + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: nil, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + }, + Seals: []*configutil.KMS{ + { + Type: "aead", + Purpose: []string{"root"}, + Disabled: false, + PluginPath: "", + PluginChecksum: "", + PluginHashMethod: "", + Config: map[string]string{ + "aead_type": "aes-gcm", + "key": "sP1fnF5Xz85RrXyELHFeZg9Ad2qt4Z4bgNHVGtD6ung=", + "key_id": "global_root", + }, + }, + { + Type: "aead", + Purpose: []string{"worker-auth"}, + Disabled: false, + PluginPath: "", + PluginChecksum: "", + PluginHashMethod: "", + Config: map[string]string{ + "aead_type": "aes-gcm", + "key": "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=", + "key_id": "global_worker-auth", + }, + }, + { + Type: "aead", + Purpose: []string{"recovery"}, + Disabled: false, + PluginPath: "", + PluginChecksum: "", + PluginHashMethod: "", + Config: map[string]string{ + "aead_type": "aes-gcm", + "key": "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=", + "key_id": "global_recovery", + }, + }, + }, + Entropy: nil, + DisableMlock: true, + DisableMlockRaw: nil, + Telemetry: nil, + DefaultMaxRequestDuration: 0, + DefaultMaxRequestDurationRaw: nil, + LogFormat: "", + LogLevel: "", + PidFile: "", + ClusterName: "", + }, + Worker: &config.Worker{ + Name: "worker0", + Description: "A worker", + PublicAddr: "", + InitialUpstreams: []string{"boundary:9201"}, + InitialUpstreamsRaw: []interface{}{"boundary:9201"}, + ControllersRaw: nil, + Tags: nil, + TagsRaw: nil, + StatusGracePeriodDuration: 0, + AuthStoragePath: "", + ControllerGeneratedActivationToken: "", + }, + Controller: &config.Controller{ + Name: "controller0", + Description: "A controller but duplicated", + Database: &config.Database{ + Url: "env://LOAD_TEST_BOUNDARY_POSTGRES_URL", + MigrationUrl: "", + MaxOpenConnections: 0, + MaxOpenConnectionsRaw: nil, + MaxIdleConnections: nil, + MaxIdleConnectionsRaw: nil, + ConnMaxIdleTime: nil, + ConnMaxIdleTimeDuration: nil, + SkipSharedLockAcquisition: false, + }, + PublicClusterAddr: "", + Scheduler: nil, + AuthTokenTimeToLive: nil, + AuthTokenTimeToLiveDuration: 0, + AuthTokenTimeToStale: nil, + AuthTokenTimeToStaleDuration: 0, + GracefulShutdownWait: nil, + GracefulShutdownWaitDuration: 0, + StatusGracePeriodDuration: 0, + }, + DevController: false, + DevUiPassthroughDir: "", + DevControllerKey: "", + DevWorkerAuthKey: "", + DevWorkerAuthStorageKey: "", + DevRecoveryKey: "", + Eventing: &event.EventerConfig{ + AuditEnabled: false, + ObservationsEnabled: true, + SysEventsEnabled: true, + Sinks: []*event.SinkConfig{ + { + Name: "default", + Description: "", + EventTypes: []event.Type{"*"}, + EventSourceUrl: "", + AllowFilters: nil, + DenyFilters: nil, + Format: event.JSONSinkFormat, + Type: event.StderrSink, + StderrConfig: nil, + FileConfig: nil, + WriterConfig: nil, + AuditConfig: &event.AuditConfig{ + FilterOverrides: map[event.DataClassification]event.FilterOperation{ + event.SecretClassification: event.RedactOperation, + event.SensitiveClassification: event.RedactOperation, + }, + FilterOverridesHCL: nil, + }, + }, + }, + }, + Plugins: config.Plugins{ + ExecutionDir: "", + }, + HcpbClusterId: "", + }, + nil, + }, + { + "SingleFileJSON", + &config.Config{ + SharedConfig: &configutil.SharedConfig{ + EntSharedConfig: configutil.EntSharedConfig{}, + Listeners: []*listenerutil.ListenerConfig{ + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "api", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"api"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: func() *bool { t := true; return &t }(), + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: []string{"*"}, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "cluster", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"cluster"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: nil, + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: nil, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "proxy", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"proxy"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: nil, + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: nil, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + { + RawConfig: map[string]interface{}{ + "address": "boundary", + "purpose": "ops", + "tls_disable": true, + }, + Type: "tcp", + Purpose: []string{"ops"}, + PurposeRaw: nil, + Address: "boundary", + ClusterAddress: "", + MaxRequestSize: 0, + MaxRequestSizeRaw: nil, + MaxRequestDuration: 0, + MaxRequestDurationRaw: nil, + RequireRequestHeader: false, + RequireRequestHeaderRaw: nil, + TLSDisable: true, + TLSDisableRaw: nil, + TLSCertFile: "", + TLSKeyFile: "", + TLSMinVersion: "", + TLSMaxVersion: "", + TLSCipherSuites: nil, + TLSCipherSuitesRaw: "", + TLSPreferServerCipherSuites: false, + TLSPreferServerCipherSuitesRaw: nil, + TLSRequireAndVerifyClientCert: false, + TLSRequireAndVerifyClientCertRaw: nil, + TLSClientCAFile: "", + TLSDisableClientCerts: false, + TLSDisableClientCertsRaw: nil, + HTTPReadTimeout: 0, + HTTPReadTimeoutRaw: nil, + HTTPReadHeaderTimeout: 0, + HTTPReadHeaderTimeoutRaw: nil, + HTTPWriteTimeout: 0, + HTTPWriteTimeoutRaw: nil, + HTTPIdleTimeout: 0, + HTTPIdleTimeoutRaw: nil, + ProxyProtocolBehavior: "", + ProxyProtocolAuthorizedAddrs: nil, + ProxyProtocolAuthorizedAddrsRaw: nil, + XForwardedForAuthorizedAddrs: nil, + XForwardedForAuthorizedAddrsRaw: nil, + XForwardedForHopSkips: 0, + XForwardedForHopSkipsRaw: nil, + XForwardedForRejectNotPresent: false, + XForwardedForRejectNotPresentRaw: nil, + XForwardedForRejectNotAuthorized: false, + XForwardedForRejectNotAuthorizedRaw: nil, + SocketMode: "", + SocketUser: "", + SocketGroup: "", + Telemetry: listenerutil.ListenerTelemetry{ + UnauthenticatedMetricsAccess: false, + UnauthenticatedMetricsAccessRaw: nil, + }, + RandomPort: false, + CorsEnabledRaw: nil, + CorsEnabled: nil, + CorsDisableDefaultAllowedOriginValuesRaw: nil, + CorsDisableDefaultAllowedOriginValues: nil, + CorsAllowedOrigins: nil, + CorsAllowedHeaders: nil, + CorsAllowedHeadersRaw: nil, + }, + }, + Seals: []*configutil.KMS{ + { + Type: "aead", + Purpose: []string{"root"}, + Disabled: false, + PluginPath: "", + PluginChecksum: "", + PluginHashMethod: "", + Config: map[string]string{ + "aead_type": "aes-gcm", + "key": "sP1fnF5Xz85RrXyELHFeZg9Ad2qt4Z4bgNHVGtD6ung=", + "key_id": "global_root", + }, + }, + { + Type: "aead", + Purpose: []string{"worker-auth"}, + Disabled: false, + PluginPath: "", + PluginChecksum: "", + PluginHashMethod: "", + Config: map[string]string{ + "aead_type": "aes-gcm", + "key": "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=", + "key_id": "global_worker-auth", + }, + }, + { + Type: "aead", + Purpose: []string{"recovery"}, + Disabled: false, + PluginPath: "", + PluginChecksum: "", + PluginHashMethod: "", + Config: map[string]string{ + "aead_type": "aes-gcm", + "key": "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=", + "key_id": "global_recovery", + }, + }, + }, + Entropy: nil, + DisableMlock: true, + DisableMlockRaw: nil, + Telemetry: nil, + DefaultMaxRequestDuration: 0, + DefaultMaxRequestDurationRaw: nil, + LogFormat: "", + LogLevel: "", + PidFile: "", + ClusterName: "", + }, + Worker: &config.Worker{ + Name: "worker0", + Description: "A worker", + PublicAddr: "", + InitialUpstreams: []string{"boundary:9201"}, + InitialUpstreamsRaw: []interface{}{"boundary:9201"}, + ControllersRaw: nil, + Tags: nil, + TagsRaw: nil, + StatusGracePeriodDuration: 0, + AuthStoragePath: "", + ControllerGeneratedActivationToken: "", + }, + Controller: &config.Controller{ + Name: "controller0", + Description: "A controller", + Database: &config.Database{ + Url: "env://LOAD_TEST_BOUNDARY_POSTGRES_URL", + MigrationUrl: "", + MaxOpenConnections: 0, + MaxOpenConnectionsRaw: nil, + MaxIdleConnections: nil, + MaxIdleConnectionsRaw: nil, + ConnMaxIdleTime: nil, + ConnMaxIdleTimeDuration: nil, + SkipSharedLockAcquisition: false, + }, + PublicClusterAddr: "", + Scheduler: nil, + AuthTokenTimeToLive: nil, + AuthTokenTimeToLiveDuration: 0, + AuthTokenTimeToStale: nil, + AuthTokenTimeToStaleDuration: 0, + GracefulShutdownWait: nil, + GracefulShutdownWaitDuration: 0, + StatusGracePeriodDuration: 0, + }, + DevController: false, + DevUiPassthroughDir: "", + DevControllerKey: "", + DevWorkerAuthKey: "", + DevWorkerAuthStorageKey: "", + DevRecoveryKey: "", + Eventing: &event.EventerConfig{ + AuditEnabled: false, + ObservationsEnabled: true, + SysEventsEnabled: true, + Sinks: []*event.SinkConfig{ + { + Name: "default", + Description: "", + EventTypes: []event.Type{"*"}, + EventSourceUrl: "", + AllowFilters: nil, + DenyFilters: nil, + Format: event.JSONSinkFormat, + Type: event.StderrSink, + StderrConfig: nil, + FileConfig: nil, + WriterConfig: nil, + AuditConfig: &event.AuditConfig{ + FilterOverrides: map[event.DataClassification]event.FilterOperation{ + event.SecretClassification: event.RedactOperation, + event.SensitiveClassification: event.RedactOperation, + }, + FilterOverridesHCL: nil, + }, + }, + }, + }, + Plugins: config.Plugins{ + ExecutionDir: "", + }, + HcpbClusterId: "", + }, + nil, + }, + { + // Note that this does not error, but also does not work as expected/desired + "MultiFileJSON", + &config.Config{ + SharedConfig: &configutil.SharedConfig{ + EntSharedConfig: configutil.EntSharedConfig{}, + Listeners: nil, + Seals: nil, + Entropy: nil, + DisableMlock: true, + DisableMlockRaw: nil, + Telemetry: nil, + DefaultMaxRequestDuration: 0, + DefaultMaxRequestDurationRaw: nil, + LogFormat: "", + LogLevel: "", + PidFile: "", + ClusterName: "", + }, + Worker: nil, + Controller: &config.Controller{ + Name: "controller0", + Description: "A controller", + Database: &config.Database{ + Url: "env://LOAD_TEST_BOUNDARY_POSTGRES_URL", + MigrationUrl: "", + MaxOpenConnections: 0, + MaxOpenConnectionsRaw: nil, + MaxIdleConnections: nil, + MaxIdleConnectionsRaw: nil, + ConnMaxIdleTime: nil, + ConnMaxIdleTimeDuration: nil, + SkipSharedLockAcquisition: false, + }, + PublicClusterAddr: "", + Scheduler: nil, + AuthTokenTimeToLive: nil, + AuthTokenTimeToLiveDuration: 0, + AuthTokenTimeToStale: nil, + AuthTokenTimeToStaleDuration: 0, + GracefulShutdownWait: nil, + GracefulShutdownWaitDuration: 0, + StatusGracePeriodDuration: 0, + }, + DevController: false, + DevUiPassthroughDir: "", + DevControllerKey: "", + DevWorkerAuthKey: "", + DevWorkerAuthStorageKey: "", + DevRecoveryKey: "", + Eventing: &event.EventerConfig{ + AuditEnabled: false, + ObservationsEnabled: true, + SysEventsEnabled: true, + Sinks: []*event.SinkConfig{ + { + Name: "default", + Description: "", + EventTypes: []event.Type{"*"}, + EventSourceUrl: "", + AllowFilters: nil, + DenyFilters: nil, + Format: event.JSONSinkFormat, + Type: event.StderrSink, + StderrConfig: nil, + FileConfig: nil, + WriterConfig: nil, + AuditConfig: &event.AuditConfig{ + FilterOverrides: map[event.DataClassification]event.FilterOperation{ + event.SecretClassification: event.RedactOperation, + event.SensitiveClassification: event.RedactOperation, + }, + FilterOverridesHCL: nil, + }, + }, + }, + }, + Plugins: config.Plugins{ + ExecutionDir: "", + }, + HcpbClusterId: "", + }, + nil, + }, + { + "MultiFileMix", + nil, + fmt.Errorf("Error parsing KMS HCL: At 30:1: expected: IDENT | STRING got: LBRACE"), + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + var paths []string + files, err := ioutil.ReadDir(fmt.Sprintf("testdata/%s", t.Name())) + require.NoError(t, err) + for _, file := range files { + if !file.IsDir() { + paths = append(paths, fmt.Sprintf("testdata/%s/%s", t.Name(), file.Name())) + } + } + + ctx := context.Background() + cfg, err := config.Load(ctx, paths, "") + if tc.expectedErr != nil { + require.Equal(t, tc.expectedErr.Error(), err.Error()) + } else { + require.NoError(t, err) + } + require.Equal(t, tc.expected, cfg) + }) + } +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFile/00-controller.hcl b/internal/cmd/config/testdata/TestLoad/MultiFile/00-controller.hcl new file mode 100644 index 000000000..e831b1469 --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFile/00-controller.hcl @@ -0,0 +1,28 @@ +disable_mlock = true + +controller { + name = "controller0" + description = "A controller" + + database { + url = "env://LOAD_TEST_BOUNDARY_POSTGRES_URL" + } +} + +listener "tcp" { + address = "boundary" + purpose = "api" + tls_disable = true +} + +listener "tcp" { + address = "boundary" + purpose = "cluster" + tls_disable = true +} + +listener "tcp" { + address = "boundary" + purpose = "ops" + tls_disable = true +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFile/01-worker.hcl b/internal/cmd/config/testdata/TestLoad/MultiFile/01-worker.hcl new file mode 100644 index 000000000..0f5b100a5 --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFile/01-worker.hcl @@ -0,0 +1,12 @@ +worker { + name = "worker0" + description = "A worker" + address = "boundary" + initial_upstreams = ["boundary:9201"] +} + +listener "tcp" { + address = "boundary" + purpose = "proxy" + tls_disable = true +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFile/02-kms.hcl b/internal/cmd/config/testdata/TestLoad/MultiFile/02-kms.hcl new file mode 100644 index 000000000..f51445494 --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFile/02-kms.hcl @@ -0,0 +1,20 @@ +kms "aead" { + purpose = "root" + aead_type = "aes-gcm" + key = "sP1fnF5Xz85RrXyELHFeZg9Ad2qt4Z4bgNHVGtD6ung=" + key_id = "global_root" +} + +kms "aead" { + purpose = "worker-auth" + aead_type = "aes-gcm" + key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=" + key_id = "global_worker-auth" +} + +kms "aead" { + purpose = "recovery" + aead_type = "aes-gcm" + key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=" + key_id = "global_recovery" +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFileDuplicateStanza/00-controller.hcl b/internal/cmd/config/testdata/TestLoad/MultiFileDuplicateStanza/00-controller.hcl new file mode 100644 index 000000000..e831b1469 --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFileDuplicateStanza/00-controller.hcl @@ -0,0 +1,28 @@ +disable_mlock = true + +controller { + name = "controller0" + description = "A controller" + + database { + url = "env://LOAD_TEST_BOUNDARY_POSTGRES_URL" + } +} + +listener "tcp" { + address = "boundary" + purpose = "api" + tls_disable = true +} + +listener "tcp" { + address = "boundary" + purpose = "cluster" + tls_disable = true +} + +listener "tcp" { + address = "boundary" + purpose = "ops" + tls_disable = true +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFileDuplicateStanza/01-controller-duplicated.hcl b/internal/cmd/config/testdata/TestLoad/MultiFileDuplicateStanza/01-controller-duplicated.hcl new file mode 100644 index 000000000..7e8b781f2 --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFileDuplicateStanza/01-controller-duplicated.hcl @@ -0,0 +1,8 @@ +controller { + name = "controller0" + description = "A controller but duplicated" + + database { + url = "env://LOAD_TEST_BOUNDARY_POSTGRES_URL" + } +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFileDuplicateStanza/01-worker.hcl b/internal/cmd/config/testdata/TestLoad/MultiFileDuplicateStanza/01-worker.hcl new file mode 100644 index 000000000..0f5b100a5 --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFileDuplicateStanza/01-worker.hcl @@ -0,0 +1,12 @@ +worker { + name = "worker0" + description = "A worker" + address = "boundary" + initial_upstreams = ["boundary:9201"] +} + +listener "tcp" { + address = "boundary" + purpose = "proxy" + tls_disable = true +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFileDuplicateStanza/02-kms.hcl b/internal/cmd/config/testdata/TestLoad/MultiFileDuplicateStanza/02-kms.hcl new file mode 100644 index 000000000..f51445494 --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFileDuplicateStanza/02-kms.hcl @@ -0,0 +1,20 @@ +kms "aead" { + purpose = "root" + aead_type = "aes-gcm" + key = "sP1fnF5Xz85RrXyELHFeZg9Ad2qt4Z4bgNHVGtD6ung=" + key_id = "global_root" +} + +kms "aead" { + purpose = "worker-auth" + aead_type = "aes-gcm" + key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=" + key_id = "global_worker-auth" +} + +kms "aead" { + purpose = "recovery" + aead_type = "aes-gcm" + key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=" + key_id = "global_recovery" +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFileJSON/00-controller.json b/internal/cmd/config/testdata/TestLoad/MultiFileJSON/00-controller.json new file mode 100644 index 000000000..8e420fcee --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFileJSON/00-controller.json @@ -0,0 +1,14 @@ +{ + "disable_mlock": true, + "controller": [ + { + "database": [ + { + "url": "env://LOAD_TEST_BOUNDARY_POSTGRES_URL" + } + ], + "description": "A controller", + "name": "controller0" + } + ] +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFileJSON/01-worker.json b/internal/cmd/config/testdata/TestLoad/MultiFileJSON/01-worker.json new file mode 100644 index 000000000..6fb9fc8af --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFileJSON/01-worker.json @@ -0,0 +1,12 @@ +{ + "worker": [ + { + "address": "boundary", + "description": "A worker", + "initial_upstreams": [ + "boundary:9201" + ], + "name": "worker0" + } + ] +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFileJSON/02-kms.json b/internal/cmd/config/testdata/TestLoad/MultiFileJSON/02-kms.json new file mode 100644 index 000000000..49ad5c74b --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFileJSON/02-kms.json @@ -0,0 +1,28 @@ +{ + "kms": [ + { + "aead": { + "aead_type": "aes-gcm", + "key": "sP1fnF5Xz85RrXyELHFeZg9Ad2qt4Z4bgNHVGtD6ung=", + "key_id": "global_root", + "purpose": "root" + } + }, + { + "aead": { + "aead_type": "aes-gcm", + "key": "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=", + "key_id": "global_worker-auth", + "purpose": "worker-auth" + } + }, + { + "aead": { + "aead_type": "aes-gcm", + "key": "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=", + "key_id": "global_recovery", + "purpose": "recovery" + } + } + ] +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFileJSON/03-listener.json b/internal/cmd/config/testdata/TestLoad/MultiFileJSON/03-listener.json new file mode 100644 index 000000000..55b2fa739 --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFileJSON/03-listener.json @@ -0,0 +1,32 @@ +{ + "listener": [ + { + "tcp": { + "address": "boundary", + "purpose": "api", + "tls_disable": true + } + }, + { + "tcp": { + "address": "boundary", + "purpose": "cluster", + "tls_disable": true + } + }, + { + "tcp": { + "address": "boundary", + "purpose": "ops", + "tls_disable": true + } + }, + { + "tcp": { + "address": "boundary", + "purpose": "proxy", + "tls_disable": true + } + } + ] +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFileMix/00-controller.hcl b/internal/cmd/config/testdata/TestLoad/MultiFileMix/00-controller.hcl new file mode 100644 index 000000000..e831b1469 --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFileMix/00-controller.hcl @@ -0,0 +1,28 @@ +disable_mlock = true + +controller { + name = "controller0" + description = "A controller" + + database { + url = "env://LOAD_TEST_BOUNDARY_POSTGRES_URL" + } +} + +listener "tcp" { + address = "boundary" + purpose = "api" + tls_disable = true +} + +listener "tcp" { + address = "boundary" + purpose = "cluster" + tls_disable = true +} + +listener "tcp" { + address = "boundary" + purpose = "ops" + tls_disable = true +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFileMix/02-worker.json b/internal/cmd/config/testdata/TestLoad/MultiFileMix/02-worker.json new file mode 100644 index 000000000..6fb9fc8af --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFileMix/02-worker.json @@ -0,0 +1,12 @@ +{ + "worker": [ + { + "address": "boundary", + "description": "A worker", + "initial_upstreams": [ + "boundary:9201" + ], + "name": "worker0" + } + ] +} diff --git a/internal/cmd/config/testdata/TestLoad/MultiFileMix/03-kms.hcl b/internal/cmd/config/testdata/TestLoad/MultiFileMix/03-kms.hcl new file mode 100644 index 000000000..f51445494 --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/MultiFileMix/03-kms.hcl @@ -0,0 +1,20 @@ +kms "aead" { + purpose = "root" + aead_type = "aes-gcm" + key = "sP1fnF5Xz85RrXyELHFeZg9Ad2qt4Z4bgNHVGtD6ung=" + key_id = "global_root" +} + +kms "aead" { + purpose = "worker-auth" + aead_type = "aes-gcm" + key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=" + key_id = "global_worker-auth" +} + +kms "aead" { + purpose = "recovery" + aead_type = "aes-gcm" + key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=" + key_id = "global_recovery" +} diff --git a/internal/cmd/config/testdata/TestLoad/SingleFile/config.hcl b/internal/cmd/config/testdata/TestLoad/SingleFile/config.hcl new file mode 100644 index 000000000..6d96057e9 --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/SingleFile/config.hcl @@ -0,0 +1,62 @@ +disable_mlock = true + +controller { + name = "controller0" + description = "A controller" + + database { + url = "env://LOAD_TEST_BOUNDARY_POSTGRES_URL" + } +} + +worker { + name = "worker0" + description = "A worker" + address = "boundary" + initial_upstreams = ["boundary:9201"] +} + +listener "tcp" { + address = "boundary" + purpose = "api" + tls_disable = true +} + +listener "tcp" { + address = "boundary" + purpose = "cluster" + tls_disable = true +} + +listener "tcp" { + address = "boundary" + purpose = "proxy" + tls_disable = true +} + +listener "tcp" { + address = "boundary" + purpose = "ops" + tls_disable = true +} + +kms "aead" { + purpose = "root" + aead_type = "aes-gcm" + key = "sP1fnF5Xz85RrXyELHFeZg9Ad2qt4Z4bgNHVGtD6ung=" + key_id = "global_root" +} + +kms "aead" { + purpose = "worker-auth" + aead_type = "aes-gcm" + key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=" + key_id = "global_worker-auth" +} + +kms "aead" { + purpose = "recovery" + aead_type = "aes-gcm" + key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=" + key_id = "global_recovery" +} diff --git a/internal/cmd/config/testdata/TestLoad/SingleFileJSON/config.json b/internal/cmd/config/testdata/TestLoad/SingleFileJSON/config.json new file mode 100644 index 000000000..9493867c5 --- /dev/null +++ b/internal/cmd/config/testdata/TestLoad/SingleFileJSON/config.json @@ -0,0 +1,80 @@ +{ + "controller": [ + { + "database": [ + { + "url": "env://LOAD_TEST_BOUNDARY_POSTGRES_URL" + } + ], + "description": "A controller", + "name": "controller0" + } + ], + "disable_mlock": true, + "kms": [ + { + "aead": { + "aead_type": "aes-gcm", + "key": "sP1fnF5Xz85RrXyELHFeZg9Ad2qt4Z4bgNHVGtD6ung=", + "key_id": "global_root", + "purpose": "root" + } + }, + { + "aead": { + "aead_type": "aes-gcm", + "key": "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=", + "key_id": "global_worker-auth", + "purpose": "worker-auth" + } + }, + { + "aead": { + "aead_type": "aes-gcm", + "key": "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ=", + "key_id": "global_recovery", + "purpose": "recovery" + } + } + ], + "listener": [ + { + "tcp": { + "address": "boundary", + "purpose": "api", + "tls_disable": true + } + }, + { + "tcp": { + "address": "boundary", + "purpose": "cluster", + "tls_disable": true + } + }, + { + "tcp": { + "address": "boundary", + "purpose": "proxy", + "tls_disable": true + } + }, + { + "tcp": { + "address": "boundary", + "purpose": "ops", + "tls_disable": true + } + } + ], + "worker": [ + { + "address": "boundary", + "description": "A worker", + "initial_upstreams": [ + "boundary:9201" + ], + "name": "worker0" + } + ] +} diff --git a/testing/controller/controller.go b/testing/controller/controller.go index eeda16ebb..50dec0174 100644 --- a/testing/controller/controller.go +++ b/testing/controller/controller.go @@ -1,6 +1,7 @@ package controller import ( + "context" "fmt" "testing" @@ -72,7 +73,7 @@ func WithConfigFile(f string) Option { return fmt.Errorf("WithConfigFile provided more than once.") } c.setWithConfigFile = true - cfg, err := config.LoadFile(f, nil) + cfg, err := config.Load(context.Background(), []string{f}, "") if err != nil { return err }