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-27 13:53:01 -06:00
committed by Joshua Casey
co-authored by Joshua Casey
parent 76f6b725b8
commit ced8686d11
26 changed files with 405 additions and 165 deletions
@@ -1853,7 +1853,7 @@ func TestCallbackEndpoint(t *testing.T) {
jwksProviderIsUnused := jwks.NewDynamicJWKSProvider()
oauthHelper := oidc.FositeOauth2Helper(oauthStore, downstreamIssuer, hmacSecretFunc, jwksProviderIsUnused, timeoutsConfiguration, nil)
logger, log := plog.TestLogger(t)
auditLogger, actualAuditLog := plog.TestAuditLogger(t)
subject := NewHandler(
test.idps.BuildFederationDomainIdentityProvidersListerFinder(),
@@ -1861,7 +1861,7 @@ func TestCallbackEndpoint(t *testing.T) {
happyStateCodec,
happyCookieCodec,
happyUpstreamRedirectURI,
logger,
auditLogger,
)
reqContext := context.WithValue(context.Background(), struct{ name string }{name: "test"}, "request-context")
@@ -1959,7 +1959,7 @@ func TestCallbackEndpoint(t *testing.T) {
if test.wantAuditLogs != nil {
wantAuditLogs := test.wantAuditLogs(testutil.GetStateParam(t, test.path), sessionID)
testutil.WantAuditIDOnEveryAuditLog(wantAuditLogs, "fake-audit-id")
testutil.CompareAuditLogs(t, wantAuditLogs, log.String())
testutil.CompareAuditLogs(t, wantAuditLogs, actualAuditLog.String())
}
})
}