Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in audit review recurrence presets. #32843

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions api/client/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package client

import (
"testing"
"time"

"github.com/jonboulle/clockwork"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"

Expand All @@ -32,6 +32,7 @@ import (
// primarily to catch potential issues with using our "mixed" gogo + regular protobuf
// strategy.
func TestEventEqual(t *testing.T) {
clock := clockwork.NewFakeClock()
app1, err := types.NewAppV3(types.Metadata{
Name: "app1",
}, types.AppSpecV3{
Expand All @@ -56,8 +57,8 @@ func TestEventEqual(t *testing.T) {
})
require.NoError(t, err)

accessList1 := newAccessList(t, "1")
accessList2 := newAccessList(t, "2")
accessList1 := newAccessList(t, "1", clock)
accessList2 := newAccessList(t, "2", clock)

tests := []struct {
name string
Expand Down Expand Up @@ -158,7 +159,7 @@ func TestEventEqual(t *testing.T) {
}
}

func newAccessList(t *testing.T, name string) *accesslist.AccessList {
func newAccessList(t *testing.T, name string, clock clockwork.Clock) *accesslist.AccessList {
t.Helper()

accessList, err := accesslist.NewAccessList(
Expand All @@ -179,7 +180,7 @@ func newAccessList(t *testing.T, name string) *accesslist.AccessList {
},
},
Audit: accesslist.Audit{
Frequency: time.Hour,
NextAuditDate: clock.Now(),
},
MembershipRequires: accesslist.Requires{
Roles: []string{"mrole1", "mrole2"},
Expand Down
Loading
Loading