ejabberd-auth-php icon indicating copy to clipboard operation
ejabberd-auth-php copied to clipboard

Modernize

Open cburschka opened this issue 7 years ago • 1 comments

This is technically object oriented and works, but is kind of ugly to install and deploy.

Wish list:

  • Refactor to support autoloading (namespaces, etc.)
  • Release as a composer package
  • Replace PHP config with a YAML file.
  • Add an autodiscovery that is less horrible than require PLUGIN/PLUGIN.php; "{$PLUGIN}_init"();. Maybe use Symfony or something.
  • Support multi-service stuff. We can't instantiate multiple CMS in the same process, but we can maintain more than one configuration and select one when starting the process.

Caveats:

  • Check if this still fills an actual use case, or is rendered obsolete by something better.
  • If not, check if anything could be useful in decreasing the scope here (maybe some standard auth protocols that are widely supported by CMS systems, and would only require glue code to connect to ejabberd)

cburschka avatar Jun 11 '17 13:06 cburschka

Status of the rewrite:

  • Refactored with PSR-4 namespaces.
  • Composer package done.
  • YAML config (via symfony/yaml) done.
  • Autodiscovery: Nope, instead configuration simply refers to a fully-qualified class name.
  • Multi-service: Abandoning the idea of instantiating a CMS (way too many side-effects). Instead, all CMS plugins should now be self-contained, and connect either to a database or to an HTTP endpoint implemented on the target CMS. Such an endpoint has been implemented for Drupal 8 at https://github.com/cburschka/ejabberd-auth-php-drupal.

(Still not sure if there is something better, but the continued interest in this project indicates that if there is, it's not easy to find. Ideally, of course, projects should use something like non-password-based SASL mechanisms, but failing adequate support inside ejabberd, a password bridge seems like the best alternative.)

cburschka avatar Jul 04 '17 17:07 cburschka