Changeset 1944

Show
Ignore:
Timestamp:
01/08/11 19:52:37 (22 months ago)
Author:
matthijs
Message:

luci-twitter: Add the FON consumer token.

This actually makes the new Twitter OAuth code work.

Closes: #1056

References: #900

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/luci/libs/twitter/luasrc/twitter.lua

    r1941 r1944  
    11module("socket.http", package.seeall) 
     2 
     3-- The consumer token shown below is registered using the official "Fon" 
     4-- twitter account and is used for authenticating all Fonera's. Note 
     5-- that even though this is referred to as a "secret", Twitter does not 
     6-- do any provider verification, so there's no harm in making this key 
     7-- public (an attacker would still need the actual access token to make 
     8-- authenticated requests, just the consumer token is never enough). 
     9local fon_consumer_key = "8yt3hYM0MkivQQ6qQGug" 
     10local fon_consumer_secret = "UujZXj55t1Ck8SEfrpzgMIrSRIRRTlKtPO87uj2Ra4" 
    211 
    312-- Fake socket.http.request function, that wraps luci.httpclient to do 
     
    3948        if not c then 
    4049                local uci = require("luci.model.uci").cursor() 
    41                 local consumer_key = uci:get("twitter", "twitter", "consumer_key") 
    42                 local consumer_secret = uci:get("twitter", "twitter", "consumer_secret") 
     50                -- These default to the consumer token defined at the 
     51                -- top of this file, but can be overridden using config 
     52                -- values (just in case this might be useful for 
     53                -- someone). 
     54                local consumer_key = uci:get("twitter", "twitter", "consumer_key") or fon_consumer_key 
     55                local consumer_secret = uci:get("twitter", "twitter", "consumer_secret") or fon_consumer_secret 
    4356                -- These will only be present when we're in the middle 
    4457                -- of oauth, but otherwise we'll just pass nils to