analytics/test/workers
Adrian Gruntkowski 373d4dd665
Implement token-based sessions (#4463)
* Turn `Plausible.Auth.UserSession` into full schema

* Implement token based sessions and use them as default

* Ignore expired user sessions during retrieval from DB

* Implement plug bumping user session last used and timeout timestamps

* Implement Oban worker removing expired user sessions with grace period

* Implement legacy session conversion on touch, when applicable

* Update `UserAuth` moduledoc

* Extend `UserAuth` tests to account for db-backed session tokens

* Update CHANGELOG

* Add tests for `UserSessionTouch` plug

* Add test for `CleanUserSessions` worker

* Add logging of legacy session retrievals

* Use single update permitting stale records  when touching user session

* Don't fetch session and user for external API endpoints (/api/event too)

* Refactor `Users.with_subscription/1` and expose helper query

* Skip fetching session in legacy `SessionTimeoutPlug`

* Rely on user session assign from `AuthContext` in `SentryContext`

* Silence legacy session warnings in `UserSessionTouchTest`

* Rely on session assign from `AuthPlug` in `SuperAdminOnlyPlug`

* Change `UserAuth` to get session, user and last subscription in one go

* Avoid refetching user session in `AuthorizeSiteAccess` plug

* Fix code formatting

* Refactor `UserAuth.get_user_token/1` (h/t @aerosol)

* Remove bogus empty opts from `scope` declarations in router

* Only touch session once an hour and keep `user.last_seen` in sync

* Bring back logging of legacy token use
2024-09-03 11:34:37 +02:00
..
accept_traffic_until_test.exs Rename internal build symbols (#3942) 2024-04-29 08:05:33 +02:00
check_usage_test.exs Always recommend a suitable plan on the choose-plan page (#4222) 2024-06-17 09:25:46 +03:00
clean_invitations_test.exs Invitations (#1122) 2021-06-16 15:00:07 +03:00
clean_user_sessions_test.exs Implement token-based sessions (#4463) 2024-09-03 11:34:37 +02:00
clickhouse_clean_sites_test.exs Refactor: remove transform_filters function from imported base (#4409) 2024-07-31 15:36:25 +03:00
expire_domain_change_transitions_test.exs Fix flaky log assertion (#3199) 2023-07-27 12:51:54 +02:00
import_analytics_test.exs Improve UI/UX of imports view and GA import flow (#4017) 2024-04-18 12:12:48 +02:00
lock_sites_test.exs Prevent upgrades that would leave the customer locked (#3683) 2024-01-15 14:59:56 +00:00
notify_annual_renewal_test.exs Refactor enterprise plan upgrade and change-plan actions (#3397) 2023-10-10 20:35:17 +03:00
notify_exported_analytics_test.exs redirect to s3 url when downloading exports (#4002) 2024-05-02 19:53:12 +01:00
oban_error_reporter_test.exs safe(r) Oban telemetry (#3743) 2024-02-14 10:12:03 +01:00
schedule_email_reports_test.exs Do not send email reports for locked sites 2021-06-17 10:20:54 +03:00
send_check_stats_emails_test.exs Conditionally support switching between v1 and v2 clickhouse schemas (#2780) 2023-03-27 13:52:42 +02:00
send_email_report_test.exs Fix email report sentry errors (#4381) 2024-07-23 12:05:42 +03:00
send_site_setup_emails_test.exs Conditionally support switching between v1 and v2 clickhouse schemas (#2780) 2023-03-27 13:52:42 +02:00
send_trial_notifications_test.exs Reapply "Define a better monthly pageview usage (#3564)" (#3574) 2023-11-30 13:30:04 +01:00
traffic_change_notifier_test.exs Onboarding improvements (#4459) 2024-09-02 12:49:54 +02:00