mirror of https://github.com/status-im/consul.git
backport ent changes to oss (#17614)
* backport ent changes to oss * Update .changelog/_5669.txt Co-authored-by: Michael Zalimeni <michael.zalimeni@hashicorp.com> --------- Co-authored-by: Michael Zalimeni <michael.zalimeni@hashicorp.com>
This commit is contained in:
parent
9a4f503b2b
commit
17f4689379
|
@ -0,0 +1,3 @@
|
|||
```release-note:improvement
|
||||
audit-logging: **(Enterprise only)** enable error response and request body logging
|
||||
```
|
|
@ -53,6 +53,22 @@ func makeACLClient(t *testing.T) (*Client, *testutil.TestServer) {
|
|||
})
|
||||
}
|
||||
|
||||
// Makes a client with Audit enabled, it requires ACLs
|
||||
func makeAuditClient(t *testing.T) (*Client, *testutil.TestServer) {
|
||||
return makeClientWithConfig(t, func(clientConfig *Config) {
|
||||
clientConfig.Token = "root"
|
||||
}, func(serverConfig *testutil.TestServerConfig) {
|
||||
serverConfig.PrimaryDatacenter = "dc1"
|
||||
serverConfig.ACL.Tokens.InitialManagement = "root"
|
||||
serverConfig.ACL.Tokens.Agent = "root"
|
||||
serverConfig.ACL.Enabled = true
|
||||
serverConfig.ACL.DefaultPolicy = "deny"
|
||||
serverConfig.Audit = &testutil.TestAuditConfig{
|
||||
Enabled: true,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func makeNonBootstrappedACLClient(t *testing.T, defaultPolicy string) (*Client, *testutil.TestServer) {
|
||||
return makeClientWithConfig(t,
|
||||
func(clientConfig *Config) {
|
||||
|
|
|
@ -75,6 +75,11 @@ type TestNetworkSegment struct {
|
|||
Advertise string `json:"advertise"`
|
||||
}
|
||||
|
||||
// TestAudigConfig contains the configuration for Audit
|
||||
type TestAuditConfig struct {
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
}
|
||||
|
||||
// Locality is used as the TestServerConfig's Locality.
|
||||
type Locality struct {
|
||||
Region string `json:"region"`
|
||||
|
@ -124,6 +129,7 @@ type TestServerConfig struct {
|
|||
Stderr io.Writer `json:"-"`
|
||||
Args []string `json:"-"`
|
||||
ReturnPorts func() `json:"-"`
|
||||
Audit *TestAuditConfig `json:"audit,omitempty"`
|
||||
}
|
||||
|
||||
type TestACLs struct {
|
||||
|
|
Loading…
Reference in New Issue