summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pazdziora <jpazdziora@redhat.com>2018-07-17 10:04:07 +0200
committerJan Pazdziora <jpazdziora@redhat.com>2018-07-17 19:24:53 +0200
commit9236628dbac1c2d99d752731e8391fa1307f2b0c (patch)
tree646d6041f3a89360d07ad584b138a5f1055464df
parent679b087142484c113c1de863a7fb956354dc43a2 (diff)
downloadmod_authnz_pam-9236628dbac1c2d99d752731e8391fa1307f2b0c.tar.gz
mod_authnz_pam-9236628dbac1c2d99d752731e8391fa1307f2b0c.tar.xz
mod_authnz_pam-9236628dbac1c2d99d752731e8391fa1307f2b0c.zip
On Apache 2.4, test AuthBasicProvider socache PAM + AuthnCacheProvideFor PAM.
-rw-r--r--tests/auth-socache.conf9
-rwxr-xr-xtests/config.sh3
-rwxr-xr-xtests/run.sh13
3 files changed, 25 insertions, 0 deletions
diff --git a/tests/auth-socache.conf b/tests/auth-socache.conf
new file mode 100644
index 0000000..9d35f2c
--- /dev/null
+++ b/tests/auth-socache.conf
@@ -0,0 +1,9 @@
+
+LoadModule authn_socache_module modules/mod_authn_socache.so
+
+ScriptAlias /authn-cached /var/www/cgi-bin/auth.cgi
+<Location /authn-cached>
+ AuthBasicProvider socache PAM
+ AuthnCacheProvideFor PAM
+ AuthnCacheTimeout 10
+</Location>
diff --git a/tests/config.sh b/tests/config.sh
index 6de8697..6a16991 100755
--- a/tests/config.sh
+++ b/tests/config.sh
@@ -12,4 +12,7 @@ chmod a+x /var/log/httpd
touch /var/log/httpd/pam_exec.log
chown apache /var/log/httpd/pam_exec.log
cp tests/auth.conf /etc/httpd/conf.d/
+if rpm -ql httpd | grep mod_authn_socache ; then
+ cat tests/auth-socache.conf >> /etc/httpd/conf.d/auth.conf
+fi
htpasswd -bc /etc/htpasswd alice Tajnost
diff --git a/tests/run.sh b/tests/run.sh
index 6986a30..6b5ea4e 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -26,3 +26,16 @@ echo Secret > /etc/pam-auth/bob
curl -u bob:Secret -s http://localhost/authn | tee /dev/stderr | grep 'User bob'
echo Secret2 > /etc/pam-auth/bob
curl -u bob:Secret -s -D /dev/stdout -o /dev/null http://localhost/authn | tee /dev/stderr | grep 401
+
+if rpm -ql httpd | grep mod_authn_socache ; then
+ echo "Testing AuthBasicProvider socache PAM + AuthnCacheProvideFor PAM"
+ curl -s -D /dev/stdout -o /dev/null http://localhost/authn | tee /dev/stderr | grep 401
+ curl -u bob:Secret -s -D /dev/stdout -o /dev/null http://localhost/authn-cached | tee /dev/stderr | grep 401
+ echo Secret > /etc/pam-auth/bob
+ curl -u bob:Secret -s http://localhost/authn-cached | tee /dev/stderr | grep 'User bob'
+ echo Secret2 > /etc/pam-auth/bob
+ curl -u bob:Secret -s -D /dev/stdout -o /dev/null http://localhost/authn | tee /dev/stderr | grep 401
+ curl -u bob:Secret -s http://localhost/authn-cached | tee /dev/stderr | grep 'User bob'
+ sleep 11
+ curl -u bob:Secret -s -D /dev/stdout -o /dev/null http://localhost/authn-cached | tee /dev/stderr | grep 401
+fi