Mercurial > prosody-wiki
annotate mod_register_json.wiki @ 188:388b6728f506
Added missing options to the wiki.
author | maranda3985@gmail.com |
---|---|
date | Wed, 13 Apr 2011 03:43:49 +0000 |
parents | 4a6c1e35788c |
children | 479655c59e6d |
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 | 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 | 30 Hint: pairing with mod_register_url is helpful, to allow server registrations only via your webform. |
31 | |
184
ad1b7e71c32e
Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff
changeset
|
32 Optional configuration directives: |
ad1b7e71c32e
Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff
changeset
|
33 {{{ |
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. |
188 | 35 reg_servlet_port = { *your port number here* } -- Uses a custom port number for the listener. |
187 | 36 reg_servlet_ttime = seconds -- Specifies the time (in seconds) between each request coming from the same remote address. |
184
ad1b7e71c32e
Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff
changeset
|
37 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. |
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. |
ad1b7e71c32e
Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff
changeset
|
39 }}} |
ad1b7e71c32e
Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff
changeset
|
40 |
188 | 41 Optional TLS directives: |
42 {{{ | |
43 reg_servlet_sslcert = "path/to/your/cert" -- Your tls/ssl cert file. | |
44 reg_servlet_sslkey = "path/to/your/key" -- Your tls/ssl key file. | |
45 }}} | |
46 *To activate SSL/TLS on a listener both options need to be correctly set.* | |
47 | |
184
ad1b7e71c32e
Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff
changeset
|
48 = Compatibility = |
ad1b7e71c32e
Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff
changeset
|
49 |
ad1b7e71c32e
Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff
changeset
|
50 Trunk - works. |
188 | 51 |
184
ad1b7e71c32e
Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff
changeset
|
52 0.8 - untested. |
188 | 53 |
184
ad1b7e71c32e
Created wiki page through web user interface.
maranda3985@gmail.com
parents:
diff
changeset
|
54 0.7 - untested. |