# HG changeset patch # User maranda3985@gmail.com # Date 1302651297 0 # Node ID ad1b7e71c32ee8bd95f871d9bcc429ff49a4765f # Parent 99ccedc61bca9b1beee6b1f1c50d8ba2ad29c78c Created wiki page through web user interface. diff -r 99ccedc61bca -r ad1b7e71c32e mod_register_json.wiki --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mod_register_json.wiki Tue Apr 12 23:34:57 2011 +0000 @@ -0,0 +1,42 @@ +#summary mini JSON registration servlet. +#labels Stage-Alpha + += Introduction = + +This module let's you activate a httpserver interface to handle data from webforms with POST and JSON. + += Details = + +It will accept the following format: + +{{{ +POST /your_register_base_url HTTP/1.0 +Host: yourserveraddress.com:yourchoosenport +Authorization: Basic base64authstring +Content-Type: application/json + +{"username":"usernameofchoice","password":"theuserpassword","host":"yourserverorvhostaddress","ip":"theremoteaddroftheuser"} +}}} + +It will require a server admin (of the given host) to provide valid credentials to submit data via Basic HTTP auth first. + +The ip field is at the moment is required to be present even if unset (""), you will require to set it using the webserver's REMOTE_ADDR global (or similar) to pass the client's ip address should you want to employ throttling/blacklisting/whitelisting of requests. + += Usage = + +Copy the module file into your prosody modules directory. +Load the module in your configuration file's global section (Host "*"), that would suffice to run it. + +Optional configuration directives: +{{{ +reg_servlet_realm = "Your Realm Name of choice" -- Modifies the name of the authentication realm. +reg_servlet_ttime = minutes -- Specifies the time (in minutes) between each request coming from the same remote address. +reg_servlet_bl = { "1.2.3.4", "4.3.2.1" } -- The ip addresses in this list will be blacklisted and won't be able to register. +reg_servlet_wl = { "1.2.3.4", "4.3.2.1" } -- The ip addresses in this list will be ignored by the throttling. +}}} + += Compatibility = + +Trunk - works. +0.8 - untested. +0.7 - untested. \ No newline at end of file