On Fri, Oct 17, 2014 at 7:36 PM, Carlos Alberto Ruiz Uribe <
carlos.ru...@softtek.com> wrote:

>
>
> *You’re right about security holes or issues, but what i mean is : Web
> client is just sending JSON commands to a local host that operates locally,
> the operations are  not on internet ,*
>


But the API doesn't know that. Whether the JSON comes from (the CLI or
HTTP) is abstracted away from the individual commands. Yes, it could be
done, but i would be very hesitant to do so. (Trivia: the main reason JSON
supports CLI mode at all is because that's much easier to develop and test
that way. The primary target of the JSON API is most certainly HTTP
clients.)


 *So i will study JSON and CSON in the source code to make somo proof of
> concept, and i will share results hardly i understand the code and can hack
> examples.*
>


It's not difficult to add new commands to the JSON API. A good starting
point is to find an existing command's entry point function, then grep that
function name:

[stephan@host:~/cvs/fossil/fossil/src]$ grep -w json_page_user *.c
json.c:cson_value * json_page_user();
json.c:{"user",json_page_user,0},
json_user.c:cson_value * json_page_user(){

That will lead you to both the implementation and the place where that
function needs to be registered so that it shows up in the list of JSON
subcommands.

Feel free to post questions and suggestions.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to