From 7b81b76ed23a208b7c85d3891e686a5b89984085 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Sat, 2 Jan 2016 01:13:40 +0200 Subject: [PATCH] ejabberd: Add support for external authentication cache --- ejabberd/manifests/init.pp | 5 +++++ ejabberd/templates/ejabberd.yml.erb | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ejabberd/manifests/init.pp b/ejabberd/manifests/init.pp index 11c00b5..04b44d4 100644 --- a/ejabberd/manifests/init.pp +++ b/ejabberd/manifests/init.pp @@ -24,6 +24,10 @@ # $extauth: # Path to external authentication command. # +# $extauth_cache: +# Number of seconds that ejabberd can cache external authentication +# information. Disabled by default. +# # $muclog_datadir: # Path where to store chatroom logs. Disabled by default. # @@ -68,6 +72,7 @@ class ejabberd( $webhosts=undef, $auth='internal', $extauth=undef, + $extauth_cache=false, $muclog_datadir=undef, $muclog_format='plaintext', $ssl_key="${::puppet_ssldir}/private_keys/${::homename}.pem", diff --git a/ejabberd/templates/ejabberd.yml.erb b/ejabberd/templates/ejabberd.yml.erb index 4ea8139..0a08638 100644 --- a/ejabberd/templates/ejabberd.yml.erb +++ b/ejabberd/templates/ejabberd.yml.erb @@ -82,6 +82,10 @@ auth_method: auth_method: <%= @auth %> <% end -%> <% if @extauth -%> +<% unless @extauth_cache == false or (@auth.is_a?(Array) and @auth.include?('internal') or @auth == 'internal') -%> +auth_password_format: scram +extauth_cache: <%= @extauth_cache %> +<% end -%> extauth_program: "<%= @extauth %>" <% end -%> <% if @ldap_server -%>