<feed xmlns='http://www.w3.org/2005/Atom'>
<title>luci/modules/luci-mod-rpc/luasrc/controller/rpc.lua, branch master</title>
<subtitle>Lua Configuration Interface (mirror)</subtitle>
<id>https://git-03.infra.openwrt.org/project/luci/atom?h=master</id>
<link rel='self' href='https://git-03.infra.openwrt.org/project/luci/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/'/>
<updated>2019-01-30T15:51:49Z</updated>
<entry>
<title>luci-mod-rpc: drop "secret" value from rpc session objects</title>
<updated>2019-01-30T15:51:49Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2019-01-30T15:48:51Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/commit/?id=766643fcf18b5710462b88adeabe5e4706ed09cf'/>
<id>urn:sha1:766643fcf18b5710462b88adeabe5e4706ed09cf</id>
<content type='text'>
Drop the "secret" value from RPC session objects in order to make them
compatible with ordinary web sessions used by the LuCI web interface.

That secret value was never used for anything and is the only difference
compared to normal LuCI login sessions.

Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>luci-mod-rpc: fix unresolved controller reference in rpc_auth()</title>
<updated>2018-05-18T14:58:17Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2018-05-18T14:58:17Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/commit/?id=364c271a84210a841762beeb2dd0715cd7c2e240'/>
<id>urn:sha1:364c271a84210a841762beeb2dd0715cd7c2e240</id>
<content type='text'>
Fixes the following error:

   .../rpc.lua:85: attempt to index global 'ctrl' (a nil value)

Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>luci-mod-rpc: more auth/login fixes, expose further libraries</title>
<updated>2018-05-05T21:11:07Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2018-05-05T20:56:30Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/commit/?id=055b621cf5cdc15b24e78408d610a00f6869b8e0'/>
<id>urn:sha1:055b621cf5cdc15b24e78408d610a00f6869b8e0</id>
<content type='text'>
The previous attempt to fix authentication broke login functionality so
rework the code once again, this time with referencing helper functions
directly via the controller scope.

Furthermore, properly expose luci.sys.wifi.getiwinfo() and luci.ip.

For getiwinfo(), the RPC wrapped function accepts one further optional
parameter specifying the operation to invoke on the iwinfo instance.
If no operation is specified, a summary object containing all info
without country and scan list is returned.

Example to obtain iwinfo summary object:
  curl --cookie sysauth=... \
       --data '{"method": "wifi.getiwinfo", "params": ["wlan0"]}' \
		"http://192.168.1.1/cgi-bin/luci/rpc/sys"

Example to obtain iwinfo scan list:
  curl --cookie sysauth=... \
       --data '{"method": "wifi.getiwinfo", "params": ["wlan0", "scanlist"]}' \
		"http://192.168.1.1/cgi-bin/luci/rpc/sys"

The exposed luci.ip class uses a similar approach to allow invoking
instance methods on cidr objects. The new(), IPv4(), IPv6() and MAC()
constructors accept two further optional arguments, with the first
specifying the instance method to invoke and the second the value to
pass to the instance method.

Example to get list of IPv4 neighbours (ARP entries):
  curl --cookie sysauth=... \
       --data '{"method": "neighbors", "params": [{"family": 4}]}' \
		"http://192.168.1.1/cgi-bin/luci/rpc/ip"

Example to add 100 hosts to a network address:
  curl --cookie sysauth=... \
       --data '{"method": "IPv4", "params": ["192.168.0.1", "255.255.255.0", "add", 1000]}' \
		"http://192.168.1.1/cgi-bin/luci/rpc/ip"

Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>luci-mod-rpc: fix authentication via query string parameter</title>
<updated>2018-05-05T17:56:26Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2018-05-05T17:51:20Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/commit/?id=6a1cdca34518fac1ca4ee2f77dad6ff60062bda5'/>
<id>urn:sha1:6a1cdca34518fac1ca4ee2f77dad6ff60062bda5</id>
<content type='text'>
Localize the `authenticatior()` and `session_retrieve()` functions into the
`index()` function scope so that they're retained when extracting the
function into the dispatcher bytecode cache.

Also allow access to the global scope since upvalues do not work reliably
due to the out-of-context byte code caching of index functions.

Fixes https://github.com/openwrt/luci/issues/1300#issuecomment-381352765
Fixes feefc600e ("luci-mod-rpc: rework authentication and session handling")
Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>luci-mod-rpc: rework authentication and session handling</title>
<updated>2018-04-06T05:56:56Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2018-04-06T05:56:56Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/commit/?id=feefc600ed052207a9cef1f331abf2eedea35a66'/>
<id>urn:sha1:feefc600ed052207a9cef1f331abf2eedea35a66</id>
<content type='text'>
 - Use the ubus session.login procedure to authenticate credentials
 - Fix testing of allowed usernames
 - Support authentication via sysauth cookie

Fixes #1300, #1700, #1711

Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>modules/luci-mod-rpc: fix attempt to index global 'luci' (a nil value)</title>
<updated>2015-09-12T09:11:18Z</updated>
<author>
<name>Sabbir Ahmed</name>
</author>
<published>2015-09-12T09:11:18Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/commit/?id=fff7c6c5188ff7a82b5d9f46a6f2c143288b5ed1'/>
<id>urn:sha1:fff7c6c5188ff7a82b5d9f46a6f2c143288b5ed1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>luci-mod-rpc: move luci config require into the authentication function (#427)</title>
<updated>2015-07-15T21:28:16Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2015-07-15T21:25:43Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/commit/?id=3610f3222d49aa521724fa721b7c5a9ba81f024d'/>
<id>urn:sha1:3610f3222d49aa521724fa721b7c5a9ba81f024d</id>
<content type='text'>
Signed-off-by: Jo-Philipp Wich &lt;jow@openwrt.org&gt;
</content>
</entry>
<entry>
<title>luci-mod-rpc: add missing luci config require</title>
<updated>2015-07-15T20:30:45Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2015-07-15T20:30:45Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/commit/?id=16047d03c54df4474cb675a9ce98d06aad5a656b'/>
<id>urn:sha1:16047d03c54df4474cb675a9ce98d06aad5a656b</id>
<content type='text'>
Signed-off-by: Jo-Philipp Wich &lt;jow@openwrt.org&gt;
</content>
</entry>
<entry>
<title>Update my email addresses in the license headers</title>
<updated>2015-01-16T22:49:44Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2015-01-16T22:46:42Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/commit/?id=41d2b33087da393453c45f5d923d690c88ee5474'/>
<id>urn:sha1:41d2b33087da393453c45f5d923d690c88ee5474</id>
<content type='text'>
Signed-off-by: Jo-Philipp Wich &lt;jow@openwrt.org&gt;
</content>
</entry>
<entry>
<title>Globally reduce copyright headers</title>
<updated>2015-01-16T22:38:38Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2015-01-16T22:38:38Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/luci/commit/?id=7a3493b1f7d75a3945279115324cf2ff4da26b7b'/>
<id>urn:sha1:7a3493b1f7d75a3945279115324cf2ff4da26b7b</id>
<content type='text'>
Signed-off-by: Jo-Philipp Wich &lt;jow@openwrt.org&gt;
</content>
</entry>
</feed>
