Commit graph

17 commits

Author SHA1 Message Date
Jo-Philipp Wich
abef50b852 libs/web: rework luci.sauth
- perform decoding/encoding transparently in read() and write()
	- remove decode() and encode() helpers
	- introduce reap() to kill expired sessions
2012-08-08 09:48:47 +00:00
Jo-Philipp Wich
a58370ab74 Rework authentication system
The validity of authentication tokens was determined by the
mtime of respective authentication tokens on filesystem
stored in $sessionpath.
Talking about hardware without RTC or without a prior
connection to a time server, date/time usually around 1970 -
so is the mtime of the authentication token file in
$sessionpath.

When now configuring an internet connection via LuCI, the
system might fetch the current date/time (e.g. via ntp)
which invalidates the token, returns "403 Forbidden" and
kicks the user out of the interface.

This patch changes the authentication system to use time values
based on the uptime of the machine - rather than values based upon
gettimeofday() and {a|m}time values - and save them inside the token.
That way can always determine the difference between login
(last interaction respectively) and the current time, in-
dependant of the system clock jumping backwards/forwards.

Warning: This patch removes the clean() function and respective calls.
This means, invalid tokens will NOT be determined and removed from
filesystem automatically anymore.
Before, every HTTP-call caused a scan for invalid tokens,
which is quite expensive. Instead consider using a cron job
deleting all stalled files periodically.

Contributed by T-Labs, Deutsche Telekom Innovation Laboratories

Signed-off-by: Mirko Vogt <mirko@openwrt.org>
2012-08-07 19:11:56 +00:00
Steven Barth
8b65a44fe8 Typo 2009-07-31 17:08:59 +00:00
Steven Barth
f648ab3445 Fix cookie logout 2009-07-31 17:08:18 +00:00
Jo-Philipp Wich
8fcd841aa9 convert luci.fs users to nixio.fs api 2009-07-19 00:24:58 +00:00
Steven Barth
30b216f774 Drop support for luaposix and bitlib (obsoleted by nixio)
Mark luci.fs as deprecated
2009-06-21 13:42:26 +00:00
Steven Barth
8b978f79fc Added luci.sauth.kill, sanitize luci.sauth even more 2008-12-14 21:42:59 +00:00
Steven Barth
c03bde275f Inprove sanity check for luci.sauth.read 2008-09-05 14:52:06 +00:00
Steven Barth
e2e1cf5497 Fixed some minor session handling issues 2008-09-05 14:28:36 +00:00
Steven Barth
bb8137062f libs/web: Added several sanity checks to avoid local privilege escalation 2008-09-01 16:05:34 +00:00
Steven Barth
37b3fba688 Fixed last commit 2008-08-11 10:51:02 +00:00
Steven Barth
fdce917da5 libs/web: Even more sanity checks 2008-08-11 10:49:44 +00:00
Steven Barth
f83bb9996b libs/web: Add additional sanity checks to session mechanism 2008-08-11 10:43:31 +00:00
Steven Barth
5b43543226 libs/web: Small improvements, added inline documentation 2008-07-29 20:32:02 +00:00
Steven Barth
e5df13e80e libs: Fixed serialization stuff 2008-07-26 17:24:46 +00:00
Steven Barth
00aceaf624 * libs/web: Switched from HTTP-Basic-Auth to Session-Auth
* Updated Makefiles for better testing environment integration
* Fixed libs/sgi-luci
2008-06-28 16:03:54 +00:00
Steven Barth
289b8fc1b6 * libs/web: Prepare session authentication 2008-06-27 20:29:05 +00:00