mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
feat(enterprise/audit): add user object to slog exporter (#9456)
This commit is contained in:
@ -7,10 +7,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
"github.com/coder/coder/v2/coderd/database/dbauthz"
|
||||
"github.com/coder/coder/v2/coderd/rbac"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uber.org/goleak"
|
||||
@ -18,6 +14,9 @@ import (
|
||||
agplaudit "github.com/coder/coder/v2/coderd/audit"
|
||||
"github.com/coder/coder/v2/coderd/coderdtest"
|
||||
"github.com/coder/coder/v2/coderd/database"
|
||||
"github.com/coder/coder/v2/coderd/database/dbauthz"
|
||||
"github.com/coder/coder/v2/coderd/database/dbfake"
|
||||
"github.com/coder/coder/v2/coderd/rbac"
|
||||
"github.com/coder/coder/v2/codersdk"
|
||||
"github.com/coder/coder/v2/enterprise/audit"
|
||||
"github.com/coder/coder/v2/enterprise/coderd"
|
||||
@ -185,7 +184,7 @@ func TestAuditLogging(t *testing.T) {
|
||||
_, _, api, _ := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
|
||||
AuditLogging: true,
|
||||
Options: &coderdtest.Options{
|
||||
Auditor: audit.NewAuditor(audit.DefaultFilter),
|
||||
Auditor: audit.NewAuditor(dbfake.New(), audit.DefaultFilter),
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
@ -194,7 +193,7 @@ func TestAuditLogging(t *testing.T) {
|
||||
},
|
||||
})
|
||||
auditor := *api.AGPL.Auditor.Load()
|
||||
ea := audit.NewAuditor(audit.DefaultFilter)
|
||||
ea := audit.NewAuditor(dbfake.New(), audit.DefaultFilter)
|
||||
t.Logf("%T = %T", auditor, ea)
|
||||
assert.EqualValues(t, reflect.ValueOf(ea).Type(), reflect.ValueOf(auditor).Type())
|
||||
})
|
||||
|
Reference in New Issue
Block a user