Limit audit events controller to 31 days date range
Problem to solve
Prompted by @huzaifaiftikhar1's question I noticed that the maximum date range of 31
days for filtering audit events [docs] is only enforced in the frontend and not in the backend in our audit events controllers. This means that a user can select a range of more than 31 days by editing the URL query.
Screenshot
[GDK_HOST]/admin/audit_logs?created_after=2021-06-01&created_before=2021-10-31 |
---|
Suggested solution
Update the audit events controller to enforce the maximum date range of 31
days.
Implementation guide
-
Update audit events controllers (instance, group, project) -
Update controller specs
Edited by Dan Jensen