analytics/test/plausible_web/controllers
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
..
api Implement token-based sessions (#4463) 2024-09-03 11:34:37 +02:00
auth_controller Fix flaky auth rate limit tests and refactor auth rate limiting (#4401) 2024-08-09 14:58:34 +02:00
CSVs APIv2: TimeSeries using QueryBuilder, release experimental_session_count (#4305) 2024-07-09 14:25:02 +03:00
site remove Plausible Analytics metions from CE (#4121) 2024-05-23 09:43:01 +02:00
admin_auth_controller_test.exs Rename internal build symbols (#3942) 2024-04-29 08:05:33 +02:00
admin_controller_test.exs Implement search in Details views (#4318) 2024-07-09 15:01:52 +03:00
auth_controller_sync_test.exs Rename internal build symbols (#3942) 2024-04-29 08:05:33 +02:00
auth_controller_test.exs Implement token-based sessions (#4463) 2024-09-03 11:34:37 +02:00
avatar_controller_test.exs Remove custom domains support + update build options (#3559) 2023-11-29 11:04:54 +01:00
billing_controller_test.exs Make hello@plausible.io clickable (#3746) 2024-02-01 09:43:21 +01:00
error_report_controller_test.exs Rename internal build symbols (#3942) 2024-04-29 08:05:33 +02:00
google_analytics_controller_test.exs Remove Universal Analytics import logic (#4312) 2024-07-05 13:58:42 +02:00
help_scout_controller_test.exs Add ability to lookup by email and site domain in HelpScout integration (#4377) 2024-07-26 16:26:51 +02:00
invitation_controller_test.exs Rename internal build symbols (#3942) 2024-04-29 08:05:33 +02:00
page_controller_test.exs Implement token-based sessions (#4463) 2024-09-03 11:34:37 +02:00
site_controller_test.exs Implement token-based sessions (#4463) 2024-09-03 11:34:37 +02:00
stats_controller_test.exs Onboarding improvements (#4459) 2024-09-02 12:49:54 +02:00
unsubscribe_controller_test.exs Fix email report sentry errors (#4381) 2024-07-23 12:05:42 +03:00