Commit graph

23 commits

Author SHA1 Message Date
Jo-Philipp Wich
c8ffc897e3 modules/rpc: adapt rpc controller to sauth api changes 2012-08-08 09:48:53 +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
Jo-Philipp Wich
69aa218335 return "403 Forbidden" if authentication token was given, however is invalid
Contributed by T-Labs, Deutsche Telekom Innovation Laboratories

Signed-off-by: Mirko Vogt <mirko@openwrt.org>
2012-08-07 19:11:52 +00:00
Jo-Philipp Wich
c4f70ce38a modules/rpc: remove uvl bindings 2011-01-02 19:55:21 +00:00
Jo-Philipp Wich
8fcd841aa9 convert luci.fs users to nixio.fs api 2009-07-19 00:24:58 +00:00
Steven Barth
1ee5ba632a Refined urltokens and XSRF protection 2008-12-15 10:40:45 +00:00
Steven Barth
271c53a4af Implement URL tokens
Add basic XSRF protection
2008-12-14 21:43:10 +00:00
Steven Barth
c08c0fdede Fixed last commit 2008-09-05 19:27:19 +00:00
Steven Barth
cd53740e0f Move RPC-bidnings out of the way to prevent the indexer to require them 2008-09-05 19:25:57 +00:00
Steven Barth
13579a4e21 Fix UVL RPC-API 2008-09-05 19:09:11 +00:00
Steven Barth
b02fe4b480 Fixed UVL bindings 2008-09-05 15:43:57 +00:00
Steven Barth
1358f954a7 Fixed JSON-RPC API, added uvl API-Bindings 2008-09-05 15:38:53 +00:00
Steven Barth
ffd5c4ec65 General optimizations, simplifications and improvements 2008-08-29 23:26:01 +00:00
Steven Barth
4a9259586d Fixed RPC-API 2008-08-29 17:12:35 +00:00
Steven Barth
a0650b4ca9 modules/rpc: Check for existence of external libraries
libs/sys: Small fix for API-Documentation
2008-08-29 17:06:58 +00:00
Steven Barth
77756f08b4 Publish luci.model.ipkg via JSON-RPC 2008-08-29 15:54:13 +00:00
Steven Barth
bda994c32e Completed first version of JSON-RPC API 2008-08-29 12:27:54 +00:00
Steven Barth
91ba7c42f5 UCI API changes 2008-08-26 23:00:44 +00:00
Steven Barth
df40e4df5e libs/json: Completed JSON library
modules/rpc: Added experimental JSON-RPC API
2008-08-26 17:50:32 +00:00
Steven Barth
0c5dc7bc77 libs/core: Reworked some basic libraries to not use package.seeall
libs/json: Implemented own JSON-Decoder (Encoder will follow)
modules/rpc: Preliminary implemented RPC-Exports for luci.fs, luci.sys and luci.model.uci
2008-08-26 00:53:28 +00:00
Steven Barth
3bcab66128 RPC initial authentication API completed 2008-08-22 22:13:54 +00:00
Steven Barth
4eead17501 RPC part #2 2008-08-22 20:04:04 +00:00
Steven Barth
9c6a852939 Updated XML translation system, fixed some errors with multiline-translations
Thanks: Alina Friedrichsen
2008-08-22 17:18:36 +00:00