VAULT-23334: CE changes to support exclusion in audit (#26615)

* CE changes to support exclusion in audit

* Add an external test for audit exclusion

---------

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
This commit is contained in:
Peter Wilson
2024-06-11 08:40:18 +01:00
committed by GitHub
parent 3f11c24c13
commit 961442c959
8 changed files with 160 additions and 0 deletions

View File

@@ -188,6 +188,15 @@ func TestBackend_hasEnterpriseAuditOptions(t *testing.T) {
},
expected: true,
},
"ent-opt-exclude": {
input: map[string]string{
"exclude": `{
"condition": "\"/request/mount_type\" == transit",
"fields": [ "/request/data", "/response/data" ]
}`,
},
expected: true,
},
}
for name, tc := range tests {
@@ -241,6 +250,15 @@ func TestBackend_hasInvalidAuditOptions(t *testing.T) {
},
expected: !constants.IsEnterprise,
},
"ent-opt-exclude": {
input: map[string]string{
"exclude": `{
"condition": "\"/request/mount_type\" == transit",
"fields": [ "/request/data", "/response/data" ]
}`,
},
expected: !constants.IsEnterprise,
},
}
for name, tc := range tests {