analytics/lib/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_notification.ex Re enable accept traffic until notifications (#3737) 2024-01-29 13:37:30 +01:00
check_usage.ex Remove Timex.today (#4357) 2024-07-23 09:02:14 +02:00
clean_invitations.ex Invitations (#1122) 2021-06-16 15:00:07 +03:00
clean_user_sessions.ex Implement token-based sessions (#4463) 2024-09-03 11:34:37 +02:00
clickhouse_clean_sites.ex Add support for imported custom events (#4033) 2024-05-09 13:13:19 +01:00
expire_domain_change_transitions.ex Allow domain change (#2803) 2023-04-04 10:55:12 +02:00
export_analytics.ex Reapply "Local CSV exports/imports and S3/UI updates (#3989)" (#3995) (#3996) 2024-04-11 09:15:01 +02:00
import_analytics.ex Implement resumable GA4 imports to work around rate limiting (#4049) 2024-04-30 18:06:18 +02:00
local_import_analytics_cleaner.ex Reapply "Local CSV exports/imports and S3/UI updates (#3989)" (#3995) (#3996) 2024-04-11 09:15:01 +02:00
locations_sync.ex APIv2: visit:country_name, visit:region_name, visit:city_name dimensions (#4328) 2024-08-13 09:44:58 +03:00
lock_sites.ex Fix and refactor invitation logic (#3376) 2023-10-02 14:57:57 +02:00
notify_annual_renewal.ex Refactor enterprise plan upgrade and change-plan actions (#3397) 2023-10-10 20:35:17 +03:00
notify_exported_analytics.ex Handle s3 timeout on settings page (#4036) 2024-05-13 10:17:27 +02:00
rotate_salts.ex Upgrades Oban to v2.6.1 (#967) 2021-04-26 11:32:18 +03:00
schedule_email_reports.ex Remove Timex.shift in app (#4338) 2024-07-15 13:31:58 +02:00
send_check_stats_emails.ex Do not report hard bounce e-mail errors to Sentry (#2361) 2022-10-24 07:13:23 -03:00
send_email_report.ex Remove Timex.format (#4402) 2024-08-12 10:01:13 +02:00
send_site_setup_emails.ex Feature gates (#3401) 2023-10-11 09:40:01 -03:00
send_trial_notifications.ex Remove Timex.today (#4357) 2024-07-23 09:02:14 +02:00
traffic_change_notifier.ex Onboarding improvements (#4459) 2024-09-02 12:49:54 +02:00