add config for audit logging, remove Audit() from Logger interface

Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
This commit is contained in:
Ryan Richard
2024-11-11 15:21:14 -08:00
committed by Joshua Casey
parent 76f6b725b8
commit ced8686d11
26 changed files with 405 additions and 165 deletions

View File

@@ -57,7 +57,7 @@ func TestGarbageCollectorControllerInformerFilters(t *testing.T) {
nil,
secretsInformer,
observableWithInformerOption.WithInformer, // make it possible to observe the behavior of the Filters
plog.New(),
nil,
)
secretsInformerFilter = observableWithInformerOption.GetFilterForInformer(secretsInformer)
})
@@ -139,7 +139,7 @@ func TestGarbageCollectorControllerSync(t *testing.T) {
syncContext *controllerlib.Context
fakeClock *clocktesting.FakeClock
frozenNow time.Time
auditLog *bytes.Buffer
actualAuditLog *bytes.Buffer
wantAuditLogs []testutil.WantedAuditLog
)
@@ -148,7 +148,7 @@ func TestGarbageCollectorControllerSync(t *testing.T) {
var startInformersAndController = func(idpCache dynamicupstreamprovider.DynamicUpstreamIDPProvider) {
// Set this at the last second to allow for injection of server override.
var auditLogger plog.AuditLogger
auditLogger, auditLog = plog.TestLogger(t)
auditLogger, actualAuditLog = plog.TestAuditLogger(t)
subject = GarbageCollectorController(
idpCache,
fakeClock,
@@ -198,7 +198,7 @@ func TestGarbageCollectorControllerSync(t *testing.T) {
it.After(func() {
cancelContextCancelFunc()
testutil.CompareAuditLogs(t, wantAuditLogs, auditLog.String())
testutil.CompareAuditLogs(t, wantAuditLogs, actualAuditLog.String())
})
when("there are secrets without the garbage-collect-after annotation", func() {