syncthing/cmd
Jakob Borg aa901790b9
lib/api: Save session & CSRF tokens to database, add option to stay logged in (fixes #9151) (#9284)
This adds a "token manager" which handles storing and checking expired
tokens, used for both sessions and CSRF tokens. It removes the old,
corresponding functionality for CSRFs which saved things in a file. The
result is less crap in the state directory, and active login sessions
now survive a Syncthing restart (this really annoyed me).

It also adds a boolean on login to create a longer-lived session cookie,
which is now possible and useful. Thus we can remain logged in over
browser restarts, which was also annoying... :)

<img width="1001" alt="Screenshot 2023-12-12 at 09 56 34"
src="https://github.com/syncthing/syncthing/assets/125426/55cb20c8-78fc-453e-825d-655b94c8623b">

Best viewed with whitespace-insensitive diff, as a bunch of the auth
functions became methods instead of closures which changed indentation.
2024-01-04 10:07:12 +00:00
..
stcompdirs all: Remove crypto/md5 (#7493) 2021-03-17 22:22:49 +01:00
stcrashreceiver cmd/stcrashreceiver: Add metrics for diskstore inventory 2023-11-27 08:24:59 +01:00
stdisco all: Implement suture v4-api (#6947) 2020-11-17 13:19:04 +01:00
stdiscosrv cmd/stdiscorv: Expose build info in metrics 2023-11-14 09:31:53 +01:00
stevents cmd/stevents: Add command line argument for event type filtering. (#7226) 2020-12-22 22:10:26 +01:00
stfileinfo all: Implement variable sized blocks (fixes #4807) 2018-04-16 19:08:50 +01:00
stfinddevice lib: Removal global connection registry (#8254) 2022-04-09 16:04:56 +02:00
stfindignored all: Unused args, retvals, assignments (#7926) 2021-09-08 00:11:16 +02:00
stgenfiles all: Correct various typos (#8870) 2023-05-09 08:54:02 +02:00
strelaypoolsrv cmd/strelaypoolsrv: Update map tile URL (#8985) 2023-07-16 17:20:40 +02:00
strelaysrv lib/nat, lib/upnp: IPv6 UPnP support (#9010) 2023-12-11 07:36:18 +01:00
stsigtool all: Remove usage of deprecated io/ioutil (#7971) 2021-11-22 08:59:47 +01:00
stupgrades cmd/stupgrades: Serve friendlier URLs for upgrade assets (fixes #9033) 2023-08-09 21:01:15 +02:00
stvanity all: Use new Go 1.19 atomic types (#8772) 2023-02-07 12:07:34 +01:00
stwatchfile all: Remove crypto/md5 (#7493) 2021-03-17 22:22:49 +01:00
syncthing lib/api: Save session & CSRF tokens to database, add option to stay logged in (fixes #9151) (#9284) 2024-01-04 10:07:12 +00:00
ursrv cmd/ursrv: Add metrics for incoming reports 2023-11-27 08:24:59 +01:00
.gitignore Remove reprecated st* utils 2014-07-01 12:20:25 +02:00