Add log export for audit logs and SCIM events
Route audit-log and SCIM-event exports through export_jobs with typed arguments, an iam BuildAndUploadExport/SendExportEmail implementation, and a concurrent export-job worker with stale recovery. Stream JSONL via page.WalkAll into S3, and expose the request flow on console, connect, MCP, and CLI. Co-authored-by: Bryan Frimin <bryan@getprobo.com> Signed-off-by: Sacha Al Himdani <sacha@probo.com>
This commit is contained in:
@@ -183,3 +183,32 @@ func TestLoadAllRefusesUnboundedResultSet(t *testing.T) {
|
||||
assert.Contains(t, err.Error(), "result set exceeds")
|
||||
assert.Equal(t, MaxLoadAllPages, fetchs, "stops after walking the max number of pages")
|
||||
}
|
||||
|
||||
func TestWalkAllHasNoPageCap(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
// More pages than MaxLoadAllPages: WalkAll must keep going.
|
||||
store := newLoadAllStore(MaxLoadAllPages*MaxCursorSize + 1)
|
||||
|
||||
fetchs := 0
|
||||
|
||||
var got []*loadAllItem
|
||||
|
||||
err := WalkAll(
|
||||
context.Background(),
|
||||
ascOrderBy(),
|
||||
func(_ context.Context, cursor *Cursor[testOrderField]) ([]*loadAllItem, error) {
|
||||
fetchs++
|
||||
return keysetPage(store, cursor), nil
|
||||
},
|
||||
func(rows []*loadAllItem) error {
|
||||
got = append(got, rows...)
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
require.NoError(t, err)
|
||||
require.Len(t, got, len(store))
|
||||
assert.Equal(t, loadAllValues(store), loadAllValues(got))
|
||||
assert.Greater(t, fetchs, MaxLoadAllPages)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user