summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pazdziora <jpazdziora@redhat.com>2022-01-30 15:26:11 +0100
committerJan Pazdziora <jpazdziora@redhat.com>2022-01-30 16:21:43 +0100
commit6eb946ae2a83c553566cd875e06c849214c6348f (patch)
tree96a07ef0a3d70d6a870a9d717f2b8c44e2ef0905
parent8ca561beab777f8b76d350ffa3a7821551981487 (diff)
downloadmod_intercept_form_submit-6eb946ae2a83c553566cd875e06c849214c6348f.tar.gz
mod_intercept_form_submit-6eb946ae2a83c553566cd875e06c849214c6348f.tar.xz
mod_intercept_form_submit-6eb946ae2a83c553566cd875e06c849214c6348f.zip
Add test for InterceptFormLoginSkip.
-rw-r--r--tests/auth.conf1
-rwxr-xr-xtests/config.sh2
-rwxr-xr-xtests/run.sh3
3 files changed, 6 insertions, 0 deletions
diff --git a/tests/auth.conf b/tests/auth.conf
index 9ed883d..97d4708 100644
--- a/tests/auth.conf
+++ b/tests/auth.conf
@@ -14,6 +14,7 @@ ScriptAlias /auth1r /var/www/cgi-bin/auth.cgi
InterceptFormLogin login
InterceptFormPassword password
InterceptFormPasswordRedact on
+ InterceptFormLoginSkip alice bob
</LocationMatch>
ScriptAlias /auth1s /var/www/cgi-bin/auth.cgi
diff --git a/tests/config.sh b/tests/config.sh
index 2db6364..19024dd 100755
--- a/tests/config.sh
+++ b/tests/config.sh
@@ -10,6 +10,8 @@ chmod a+x /var/log/httpd
cp tests/auth.conf /etc/httpd/conf.d/
useradd user1
echo user1:heslo1 | chpasswd
+useradd bob
+echo 'bob:Bobovo heslo' | chpasswd
NAME='liška'
if ! useradd --badname "$NAME" 2> /dev/null ; then
diff --git a/tests/run.sh b/tests/run.sh
index 738325e..cb08378 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -17,6 +17,7 @@ curl --data '' -si http://localhost/auth1 | tee /dev/stderr | grep -F 'REMOTE_US
curl --data 'login=user1&password=heslox' -si http://localhost/auth1 | tee /dev/stderr | grep -F -e 'REMOTE_USER=[]' -e 'EXTERNAL_AUTH_ERROR=[Authentication failure]' | wc -l | grep -q 2
curl --data 'login=user2&password=heslox' -si http://localhost/auth1 | tee /dev/stderr | grep -F -e 'REMOTE_USER=[]' -e 'EXTERNAL_AUTH_ERROR=[User not known to the underlying authentication module]' | wc -l | grep -q 2
curl --data 'login=user1&password=heslo1' -si http://localhost/auth1 | tee /dev/stderr | grep -F -e 'REMOTE_USER=[user1]' -e 'login=user1&password=heslo1' | wc -l | grep -q 2
+curl --data 'login=bob&password=Bobovo+heslo' -si http://localhost/auth1 | tee /dev/stderr | grep -F -e 'REMOTE_USER=[bob]' -e 'login=bob&password=Bobovo+heslo' | wc -l | grep -q 2
NAME='liška'
XNAME='li%c5%a1ka'
if ! getent passwd "$NAME" ; then
@@ -29,6 +30,8 @@ curl --data 'something=somewhere&password=heslo1&something=else&login=user1' -si
curl --data 'login=user1&password=heslo1' -si http://localhost/auth1r | tee /dev/stderr | grep -F -e 'REMOTE_USER=[user1]' -e 'login=user1&password=[REDACTED]' | wc -l | grep -q 2
curl --data 'password=xheslo&login=user1&something=extra' -si http://localhost/auth1r | tee /dev/stderr | grep -F -e 'REMOTE_USER=[]' -e 'EXTERNAL_AUTH_ERROR=[Authentication failure]' -e 'password=[REDACTED]&login=user1&something=extra' | wc -l | grep -q 3
curl --data 'something=somewhere&password=heslo1&something=else&login=user1' -si http://localhost/auth1r | tee /dev/stderr | grep -F -e 'REMOTE_USER=[user1]' -e 'something=somewhere&password=[REDACTED]&something=else&login=user1' | wc -l | grep -q 2
+curl --data 'login=bob&password=Bobovo heslo' -si http://localhost/auth1r | tee /dev/stderr | grep -F -e 'REMOTE_USER=[]' -e 'login=bob&password=Bobovo heslo' | wc -l | grep -q 2
+curl --data 'login=bob&password=Ne Bobovo heslo' -si http://localhost/auth1r | tee /dev/stderr | grep -F -e 'REMOTE_USER=[]' -e 'login=bob&password=Ne Bobovo heslo' | wc -l | grep -q 2
curl --data 'login=user1&password=heslo1' -si http://localhost/auth1s | tee /dev/stderr | grep -F -e 'REMOTE_USER=[user1]' -e 'login=user1&password=[REDACTED]' | wc -l | grep -q 2
curl --data 'something=somewhere&password=heslo1&something=else&login=user1' -si http://localhost/auth1s | tee /dev/stderr | grep -F -e 'REMOTE_USER=[user1]' -e 'something=somewhere&password=[REDACTED]&something=else&login=user1' | wc -l | grep -q 2