mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:57:31 +00:00
fix: creation date argument in search events filters (#6855)
* fix: creation date filter in event queries * fix: creation date with ordering filter * simplify code * simplify review --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -66,7 +66,13 @@ func filterAuditLogRetention(ctx context.Context, auditLogRetention time.Duratio
|
||||
if callTime.IsZero() {
|
||||
callTime = time.Now()
|
||||
}
|
||||
return builder.CreationDateAfter(callTime.Add(-auditLogRetention))
|
||||
oldestAllowed := callTime.Add(-auditLogRetention)
|
||||
// The audit log retention time should overwrite the creation date after query only if it is older
|
||||
// For example API calls should still be able to restrict the creation date after to a more recent date
|
||||
if builder.GetCreationDateAfter().Before(oldestAllowed) {
|
||||
return builder.CreationDateAfter(oldestAllowed)
|
||||
}
|
||||
return builder
|
||||
}
|
||||
|
||||
func (q *Queries) SearchEventTypes(ctx context.Context) []string {
|
||||
|
Reference in New Issue
Block a user