luci/libs
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
..
core libs/core: only consider enabled routes when finding wan interface 2012-06-29 11:59:38 +00:00
fastindex * Rewrote Luci to be coroutine-safe allowing the use of non-forking webservers 2008-06-14 14:12:12 +00:00
httpclient libs/httpclient: return server response line in error case (#249) 2011-06-25 22:57:18 +00:00
ipkg libs/ipkg: give caller more control over filter pattern 2011-10-15 03:10:19 +00:00
json libs/json: Fix a typo and a logic error in json.lua to make luci.json.encode() work like expected (#220) 2011-04-17 11:39:17 +00:00
lmo libs/lmo: skip all entries with identical key and value when generating lmo archives 2011-01-02 18:16:54 +00:00
lucid libs/lucid: fix process function leak (#285) 2011-08-11 23:23:11 +00:00
lucid-http [PATCH] Explicit Cache-Control for lucid.http static content 2012-01-09 00:04:54 +00:00
lucid-rpc GSoC: Documentation #2 2009-06-14 08:51:43 +00:00
nixio libs/nixio: reorder linker commandline args to fix build on Ubuntu 11.x 2012-03-13 22:45:26 +00:00
px5g libs/px5g: fix compilation on OpenWrt trunk 2010-11-16 16:30:07 +00:00
rpcc GSoC: Add RPC client 2009-06-14 09:02:40 +00:00
sgi-cgi move luci specific index.html from package 'sgi-cgi' to 'admin-core' 2012-05-06 18:57:18 +00:00
sgi-luci Make LuCIttpd work OOTB 2008-12-07 11:47:59 +00:00
sgi-uhttpd libs/sgi-uhttpd: move exectime inside handle_request 2010-12-15 01:04:38 +00:00
sgi-wsapi Made SGIs even more standards compliant (respect EOF command from LuCI) 2008-07-23 18:52:12 +00:00
sys libs/sys: workaround broken entries in /proc/net/ipv6_route, observed on brcm-2.4 2012-07-18 11:22:10 +00:00
web Rework authentication system 2012-08-07 19:11:56 +00:00