-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MUC http auth #894
MUC http auth #894
Commits on Aug 3, 2016
-
Add mod_http_client: a manager of pools of outgoing HTTP connections
Notes: - the module has to be started before any modules using the connections - ‘ejabberd_auth_http’ and ‘mod_http_notification’ modules will use this module in the future. To enable the module, add the corresponding config to ejabberd.cfg, eg. {mod_http_client, [{pools, [{pool1, [{host, “http://host.com”}, {pool_size, 100}] }] } This should be added before any module using the pool.
Configuration menu - View commit details
-
Copy full SHA for 7682939 - Browse repository at this point
Copy the full SHA 7682939View commit details -
Support password-protected MUC rooms using external HTTP auth service.
To enable, set the following options in ejabberd.cfg 1. Enable ‘mod_http_client’, specifying a connection pool: {mod_http_client, [{pools, [{muc_http_auth, [{host, "http://localhost:8080"}, {path_prefix, "/muc/auth/"}, {pool_size, 20}]} The above config has to occur before the MUC config to provide the pool when the MUC module starts. For details, see the ‘mod_http_client’ module. 2. Use the pool in MUC config: {mod_muc, [{host, "muc.@host@"}, {access, muc}, {access_create, muc_create}, {http_auth_pool, muc_http_auth}]} As a result, all rooms will: - become password-protected by default - call the external HTTP service instead of checking the configured password, whenever a new user enters the room The external HTTP service has to respond with: - code 200 and body ‘true’ when the password is accepted; - code 200 and other body when the password is rejected - the body will be sent back to the entity in the XMPP error response in the <text> element - other code when an error occurs, this will result in a ‘service-unavailable’ XMPP error
Configuration menu - View commit details
-
Copy full SHA for d086540 - Browse repository at this point
Copy the full SHA d086540View commit details -
Expect JSON in response for MUC authentication
Also make overflow configurable and add tests for mod_http_client
Configuration menu - View commit details
-
Copy full SHA for 6605007 - Browse repository at this point
Copy the full SHA 6605007View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8422d8a - Browse repository at this point
Copy the full SHA 8422d8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for f938ddb - Browse repository at this point
Copy the full SHA f938ddbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 487de0f - Browse repository at this point
Copy the full SHA 487de0fView commit details -
Use Cowboy instead of a homespun HTTP server
Motivation: * Tests using the same server configuration can be run in parallel, * Adding basic features like parsing GET/POST requests was like reinventing the wheel.
Configuration menu - View commit details
-
Copy full SHA for 88b0cca - Browse repository at this point
Copy the full SHA 88b0ccaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d409da - Browse repository at this point
Copy the full SHA 8d409daView commit details -
Configuration menu - View commit details
-
Copy full SHA for 934ed82 - Browse repository at this point
Copy the full SHA 934ed82View commit details
Commits on Aug 4, 2016
-
Spawn a new process for http auth only if room is non-empty.
This prevents race condition when another user would step in while the owner is still authenticating.
Configuration menu - View commit details
-
Copy full SHA for e41b3ab - Browse repository at this point
Copy the full SHA e41b3abView commit details
Commits on Aug 5, 2016
-
Make http_client an integral part of MongooseIM (not a pluggable mod.)
Motivation: * In case of multiple hosts one pool per host is not efficient * The module would need to be started first, complicating module deps * Riak connectivity layer was not a module * ejabberd.cfg is easier to understand without the extra module
Configuration menu - View commit details
-
Copy full SHA for 448fed1 - Browse repository at this point
Copy the full SHA 448fed1View commit details
Commits on Aug 8, 2016
-
Configuration menu - View commit details
-
Copy full SHA for 441c06d - Browse repository at this point
Copy the full SHA 441c06dView commit details -
(copy from small tests, maybe improve it later)
Configuration menu - View commit details
-
Copy full SHA for 6110a5d - Browse repository at this point
Copy the full SHA 6110a5dView commit details
Commits on Aug 17, 2016
-
Configuration menu - View commit details
-
Copy full SHA for bfc0e0b - Browse repository at this point
Copy the full SHA bfc0e0bView commit details