annotate mod_register_json.wiki @ 239:8b5492ea07d9

corrected typo.
author Marco Cirillo <maranda@lightwitch.org>
date Sat, 03 Dec 2011 16:47:39 +0000
parents 9278544faffb
children 08744edfffba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
184
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
1 #summary mini JSON registration servlet.
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
2 #labels Stage-Alpha
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
3
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
4 = Introduction =
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
5
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
6 This module let's you activate a httpserver interface to handle data from webforms with POST and JSON.
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
7
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
8 = Details =
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
9
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
10 It will accept the following format:
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
11
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
12 {{{
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
13 POST /your_register_base_url HTTP/1.0
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
14 Host: yourserveraddress.com:yourchoosenport
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
15 Authorization: Basic base64authstring
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
16 Content-Type: application/json
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
17
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
18 {"username":"usernameofchoice","password":"theuserpassword","host":"yourserverorvhostaddress","ip":"theremoteaddroftheuser"}
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
19 }}}
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
20
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
21 It will require a server admin (of the given host) to provide valid credentials to submit data via Basic HTTP auth first.
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
22
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
23 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.
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
24
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
25 = Usage =
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
26
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
27 Copy the module file into your prosody modules directory.
186
673fa35f880f Correction.
maranda3985@gmail.com
parents: 185
diff changeset
28 Load the module in your configuration file's global section, that would suffice to run it.
184
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
29
185
9aab3736b3ca Added hint.
maranda3985@gmail.com
parents: 184
diff changeset
30 Hint: pairing with mod_register_url is helpful, to allow server registrations only via your webform.
9aab3736b3ca Added hint.
maranda3985@gmail.com
parents: 184
diff changeset
31
184
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
32 Optional configuration directives:
229
9278544faffb correction to code block.
maranda@lightwitch.org
parents: 228
diff changeset
33 <code language="lua">
184
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
34 reg_servlet_realm = "Your Realm Name of choice" -- Modifies the name of the authentication realm.
229
9278544faffb correction to code block.
maranda@lightwitch.org
parents: 228
diff changeset
35 reg_servlet_ports = { { port = 8080, path = "your_register_path" } } -- Allows to configure custom ports see: http://prosody.im/doc/setting_up_bosh
187
4a6c1e35788c Fixed an error.
maranda3985@gmail.com
parents: 186
diff changeset
36 reg_servlet_ttime = seconds -- Specifies the time (in seconds) between each request coming from the same remote address.
228
818b1135d3e3 corrected wording.
maranda@lightwitch.org
parents: 191
diff changeset
37 reg_servlet_bl = { "1.2.3.4", "4.3.2.1" } -- The ip addresses in this list will be blacklisted and will not be able to submit registrations.
184
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
38 reg_servlet_wl = { "1.2.3.4", "4.3.2.1" } -- The ip addresses in this list will be ignored by the throttling.
229
9278544faffb correction to code block.
maranda@lightwitch.org
parents: 228
diff changeset
39 </code>
184
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
40
190
479655c59e6d Updated wiki to reflect changes.
maranda3985@gmail.com
parents: 188
diff changeset
41 Notes on ports:
479655c59e6d Updated wiki to reflect changes.
maranda3985@gmail.com
parents: 188
diff changeset
42 Modified to use, prosody's standard ports configuration format, if you don't specify any port via *port =* param, 9280 (non ssl) and 9443 (ssl) will be used.
188
388b6728f506 Added missing options to the wiki.
maranda3985@gmail.com
parents: 187
diff changeset
43
184
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
44 = Compatibility =
ad1b7e71c32e Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff changeset
45
191
c33d7df822ff Updated status for 0.8.
maranda3985@gmail.com
parents: 190
diff changeset
46 Trunk - Works.
188
388b6728f506 Added missing options to the wiki.
maranda3985@gmail.com
parents: 187
diff changeset
47
191
c33d7df822ff Updated status for 0.8.
maranda3985@gmail.com
parents: 190
diff changeset
48 0.8 - Should work.
188
388b6728f506 Added missing options to the wiki.
maranda3985@gmail.com
parents: 187
diff changeset
49
191
c33d7df822ff Updated status for 0.8.
maranda3985@gmail.com
parents: 190
diff changeset
50 0.7 - Untested.