Files
threshold/internal/cmd/config/config_load_test.go
T
Timothy MessierandJeff Mitchell d896f37493 Support reading multiple configuration files(#2504)
feat(config): Support multiple files

This updates the three subcommands that take a `-config` flag to
to support multiple config files via a repeated `-config` flag.
It updates the following subcommands:

- `server`
- `database init`
- `database migrate`

Note that the multiple file support only works if all config files are
HCL, not JSON. Also note that the config files are concatenated
together. There is no attempt to merge config files, so having the same
stanza in multiple files can yield unexpected results, with only one of
the stanzas being used.

When used with these limitations understood, this provides a way to take
different actions for different kinds of dynamic configuration changes.
An example would be when using consul-template to render the
configuration files for boundary. With the multi file support
consul-template can render one config file for the controller stanza,
and provide boundary with a dynamic database credential via vault. Then
when the credential is rotated, consul-template can send boundary a
SIGHUP to switch to the new credential without a restart. A separate
template could be used to render a config for a stanza that does not
support SIGHUP, such as the events stanza that gets its values via
consul's KV. If these values change, consul-template can restart
boundary so the new configuration is used.

Co-authored-by: Timothy Messier <tim.messier@gmail.com>
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2022-09-29 09:01:33 -04:00

1751 lines
70 KiB
Go

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)
})
}
}