aboutsummaryrefslogtreecommitdiff
path: root/t/lib-httpd
diff options
context:
space:
mode:
authorGabriel Corona <gabriel.corona@enst-bretagne.fr>2010-11-14 02:51:14 +0100
committerJunio C Hamano <gitster@pobox.com>2010-11-17 13:07:43 -0800
commit3cf8fe1d26edd7c4cce6593d70212970f8b0bbc0 (patch)
tree7cc5c84ac5c809d595217dd9150474a642b34fe5 /t/lib-httpd
parentf772c34ce09a49eb553240eb672bf0cc2dbcb10a (diff)
downloadgit-3cf8fe1d26edd7c4cce6593d70212970f8b0bbc0.tar.gz
git-3cf8fe1d26edd7c4cce6593d70212970f8b0bbc0.tar.xz
t5550: test HTTP authentication and userinfo decoding
Add a test for HTTP authentication and proper percent-decoding of the userinfo (username and password) part of the URL. Signed-off-by: Gabriel Corona <gabriel.corona@enst-bretagne.fr> Acked-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-httpd')
-rw-r--r--t/lib-httpd/apache.conf29
-rw-r--r--t/lib-httpd/passwd1
2 files changed, 30 insertions, 0 deletions
diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index 4961505d1..b40e43bb3 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -17,8 +17,30 @@ ErrorLog error.log
<IfModule !mod_env.c>
LoadModule env_module modules/mod_env.so
</IfModule>
+<IfModule !mod_version.c>
+ LoadModule version_module modules/mod_version.so
+</IfModule>
+
+<IfVersion < 2.1>
+<IfModule !mod_auth.c>
+ LoadModule auth_module modules/mod_auth.so
+</IfModule>
+</IfVersion>
+
+<IfVersion >= 2.1>
+<IfModule !mod_auth_basic.c>
+ LoadModule auth_basic_module modules/mod_auth_basic.so
+</IfModule>
+<IfModule !mod_authn_file.c>
+ LoadModule authn_file_module modules/mod_authn_file.so
+</IfModule>
+<IfModule !mod_authz_user.c>
+ LoadModule authz_user_module modules/mod_authz_user.so
+</IfModule>
+</IfVersion>
Alias /dumb/ www/
+Alias /auth/ www/auth/
<Location /smart/>
SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
@@ -48,6 +70,13 @@ SSLMutex file:ssl_mutex
SSLEngine On
</IfDefine>
+<Location /auth/>
+ AuthType Basic
+ AuthName "git-auth"
+ AuthUserFile passwd
+ Require valid-user
+</Location>
+
<IfDefine DAV>
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
diff --git a/t/lib-httpd/passwd b/t/lib-httpd/passwd
new file mode 100644
index 000000000..f2fbcad33
--- /dev/null
+++ b/t/lib-httpd/passwd
@@ -0,0 +1 @@
+user@host:nKpa8pZUHx/ic