RetroShare/libresapi/src/api
2018-01-06 18:39:47 +01:00
..
ApiPluginHandler.cpp added missing null check libresapi ApiPluginHandler 2015-12-18 19:05:18 +01:00
ApiPluginHandler.h allow plugins to integrate into the JSON API 2015-12-15 19:56:49 +01:00
ApiServer.cpp Changed in Libresapi: Pointer to RsNotify object into reference 2018-01-06 18:39:47 +01:00
ApiServer.h Added in Libresapi: Handlers to interact with shared files 2017-10-20 20:57:37 +02:00
ApiServerLocal.cpp Included QStringList header in ApiServerLocal.cpp [Issue 879] 2017-06-12 15:51:26 +05:30
ApiServerLocal.h Advances on trusted node addings 2016-09-22 12:48:08 +02:00
ApiServerMHD.cpp Advances on trusted node addings 2016-09-22 12:48:08 +02:00
ApiServerMHD.h added web interface to retroshare-gui 2015-04-24 14:31:13 +00:00
ApiTypes.h Added name of requests to be used by GUI 2017-03-25 18:23:28 +01:00
ChannelsHandler.cpp libresapi: added channels/create_post 2016-02-19 19:23:55 +01:00
ChannelsHandler.h libresapi: added channels/create_post 2016-02-19 19:23:55 +01:00
ChatHandler.cpp Libresapi: Extended ChatInfo class to contain own identity used in chat 2018-01-05 20:44:48 +01:00
ChatHandler.h Libresapi: Extended ChatInfo class to contain own identity used in chat 2018-01-05 20:44:48 +01:00
FileSearchHandler.cpp Changed in Libresapi: Locking mutex using macro instead of RsStackMutex object creation 2018-01-01 23:20:26 +01:00
FileSearchHandler.h Added in Libresapi: Handler to get search result 2017-10-20 20:49:59 +02:00
FileSharingHandler.cpp Changed in Libresapi: Pointer to RsNotify object into reference 2018-01-06 18:39:47 +01:00
FileSharingHandler.h Changed in Libresapi: Pointer to RsNotify object into reference 2018-01-06 18:39:47 +01:00
ForumHandler.cpp fixed problem in ID creation code. 2017-02-07 20:15:55 +01:00
ForumHandler.h libresapi: add basic forum read api (patch from Chozabu) close #32 2015-08-31 19:44:15 +02:00
GetPluginInterfaces.cpp allow plugins to integrate into the JSON API 2015-12-15 19:56:49 +01:00
GetPluginInterfaces.h libresapi: added statetoken to identity handler responses 2016-02-07 14:28:45 +01:00
GxsMetaOperators.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
GxsResponseTask.cpp libresapi: added chat/receive_status 2016-02-14 14:57:41 +01:00
GxsResponseTask.h libresapi: added chat/receive_status 2016-02-14 14:57:41 +01:00
IdentityHandler.cpp Changed in Libresapi: Locking mutex using macro instead of RsStackMutex object creation 2018-01-01 23:20:26 +01:00
IdentityHandler.h Added: Handling requests to set and get identity avatar 2017-06-25 14:30:38 +02:00
json.cpp Fixed a bunch of warnings in safe ways 2016-10-13 00:01:33 +02:00
json.h updated SuperEasyJSON 2015-03-27 18:43:07 +00:00
JsonStream.cpp webui: allow to set peer flags when adding friends (whitelist flag is set to false) 2015-06-04 12:57:09 +00:00
JsonStream.h - added support for multiple client threads to ApiServer 2015-03-31 18:00:40 +00:00
LivereloadHandler.cpp webui: 2015-04-29 11:57:56 +00:00
LivereloadHandler.h webui: 2015-04-29 11:57:56 +00:00
Operators.cpp libresapi: fixed bug in JSON serialisation of uint32_t, decimal digits had inverse order 2015-10-13 20:35:24 +02:00
Operators.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
Pagination.h Disable limit to 20 entries in JSON API pagination 2017-04-03 19:21:54 +02:00
PeersHandler.cpp Changed in Libresapi: Locking mutex using macro instead of RsStackMutex object creation 2018-01-01 23:20:26 +01:00
PeersHandler.h Added in Libresapi: Getting node name in PeersHandler 2017-12-27 22:38:04 +01:00
README.md added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
ResourceRouter.cpp Added name of requests to be used by GUI 2017-03-25 18:23:28 +01:00
ResourceRouter.h allow plugins to integrate into the JSON API 2015-12-15 19:56:49 +01:00
RsControlModule.cpp Changed in Libresapi: Locking mutex using macro instead of RsStackMutex object creation 2018-01-01 23:20:26 +01:00
RsControlModule.h improved the login in the interaction between terminal api client and main 2017-07-08 17:38:09 +02:00
ServiceControlHandler.cpp webui: view / change rights per user 2016-03-22 16:33:05 +01:00
ServiceControlHandler.h webui: view / change rights per user 2016-03-22 16:33:05 +01:00
SettingsHandler.cpp Added SettingsHandler to handle response to settings requests 2017-03-25 18:20:53 +01:00
SettingsHandler.h Added SettingsHandler to handle response to settings requests 2017-03-25 18:20:53 +01:00
StateTokenServer.cpp Changed in Libresapi: Locking mutex using macro instead of RsStackMutex object creation 2018-01-01 23:20:26 +01:00
StateTokenServer.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
StatsHandler.cpp add dht/nat to librespai stats 2016-08-30 21:58:07 +02:00
StatsHandler.h add stats to libresapi 2016-08-30 21:50:20 +02:00
TmpBlobStore.cpp webui: 2015-06-16 12:35:07 +00:00
TmpBlobStore.h removed unused variable in TmpBlobStore 2015-06-19 14:43:04 +00:00
TransfersHandler.cpp Changed in Libresapi: Pointer to RsNotify object into reference 2018-01-06 18:39:47 +01:00
TransfersHandler.h Changed in Libresapi: Pointer to RsNotify object into reference 2018-01-06 18:39:47 +01:00

New programming interface for Retroshare

  • access to libretroshare for webinterfaces, QML and scripting
  • client - server architecture.
  • network friendly: transport messages over high latency and low bandwidth networks
  • multiple clients: can use scripting and webinterface at the same time
  • simple packet format: no special serialiser required
  • simple protocol: one request creates one response. A requets does not depend on a previous request.
  • automatic state change propagation: if a resource on the server changes, the clients will get notified
  • no shared state: Client and server don't have to track what they send each other.
  • works with all programming languages

How does it work?

- Client sends a request: adress of a resource and optional parameters encoded as JSON
{
	"method": "get",
	"resource": ["peers"],
}
- Server sends a Response:
{
	"returncode": "ok",
	"statetoken": "ASDF",
	"data": [...]
}

- Client asks if data is still valid
{
	"method": "exec",
	"resource": "statetokenservice"
	"data": ["ASDF", "GHJK"]
}
- Server answers Client that statetoken "ASDF" expired
{
	"returncode": "ok",
	"data": ["ASDF"]
}

Transport

A transport protocol transports requests and responses between client and server.

  • tracks message boundaries, so messages don't get merged
  • may be able to handle concurrent requests with out of order delivery of responses
  • knows to which request a response belongs to

Transport could do encryption and authentication with a standardized protocol like SSH or TLS.

Ideas:

  • request id + length + request data -> SSH -> TCP -> ...
  • Websockets
  • Retroshare Items
  • Unix domain sockets

Currently only unencrypted http is implemented. libmicrohttpd (short MHD) is used as http server. Can use a proxy to add TLS encryption.

Message encoding

Currently JSON, because it is already available in JavaScript and QML. Other key-value encodings could be used as well. Read more about basic data types of different languages (JavaScript, QML, Lua, C++) in ./ApiServer.cpp.