Author: geoff
Date: Fri Jan 28 06:40:36 2005
New Revision: 148889

URL: http://svn.apache.org/viewcvs?view=rev&rev=148889
Log:
add test for fake auth using mod_authn_anon

Added:
   httpd/test/trunk/perl-framework/t/ssl/fakeauth.t
Modified:
   httpd/test/trunk/perl-framework/t/conf/ssl/ssl.conf.in

Modified: httpd/test/trunk/perl-framework/t/conf/ssl/ssl.conf.in
Url: 
http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/t/conf/ssl/ssl.conf.in?view=diff&rev=148889&p1=httpd/test/trunk/perl-framework/t/conf/ssl/ssl.conf.in&r1=148888&p2=httpd/test/trunk/perl-framework/t/conf/ssl/ssl.conf.in&r2=148889
==============================================================================
--- httpd/test/trunk/perl-framework/t/conf/ssl/ssl.conf.in      (original)
+++ httpd/test/trunk/perl-framework/t/conf/ssl/ssl.conf.in      Fri Jan 28 
06:40:36 2005
@@ -75,11 +75,12 @@
         </Location>
 
         #t/ssl/require.t
-        Alias /require/asf       @DocumentRoot@
-        Alias /require/snakeoil  @DocumentRoot@
-        Alias /ssl-fakebasicauth @DocumentRoot@
-        Alias /ssl-cgi           @DocumentRoot@/modules/cgi
-        Alias /require-ssl-cgi   @DocumentRoot@/modules/cgi
+        Alias /require/asf        @DocumentRoot@
+        Alias /require/snakeoil   @DocumentRoot@
+        Alias /ssl-fakebasicauth  @DocumentRoot@
+        Alias /ssl-fakebasicauth2 @DocumentRoot@
+        Alias /ssl-cgi            @DocumentRoot@/modules/cgi
+        Alias /require-ssl-cgi    @DocumentRoot@/modules/cgi
 
         <Location /require/asf>
             SSLVerifyClient require
@@ -119,6 +120,22 @@
                 AuthUserFile         @SSLCA@/asf/ssl.htpasswd
                 require              valid-user
             </Location>
+        </IfModule>
+
+        # specific to 2.1
+        <IfModule mod_authn_anon.c>
+            <IfModule mod_auth_basic.c>
+                <Location /ssl-fakebasicauth2>
+                    SSLVerifyClient      require
+                    SSLRequire           %{SSL_CLIENT_VERIFY} eq "SUCCESS"
+                    SSLOptions           +FakeBasicAuth +StdEnvVars
+                    AuthName             "Snake Oil Authentication"
+                    AuthType             Basic
+                    AuthBasicProvider    anon
+                    Anonymous            dummy "*"
+                    require              valid-user
+                </Location>
+            </IfModule>
         </IfModule>
 
     </VirtualHost>

Added: httpd/test/trunk/perl-framework/t/ssl/fakeauth.t
Url: 
http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/t/ssl/fakeauth.t?view=auto&rev=148889
==============================================================================
--- (empty file)
+++ httpd/test/trunk/perl-framework/t/ssl/fakeauth.t    Fri Jan 28 06:40:36 2005
@@ -0,0 +1,33 @@
+use strict;
+use warnings FATAL => 'all';
+use Apache::Test;
+use Apache::TestRequest;
+use Apache::TestConfig ();
+use Apache::TestUtil;
+
+# check fake authentication using mod_auth_anon
+# no cert should fail but the presence of any cert
+# should pass.  see also t/ssl/basicauth.t
+
+my $url = '/ssl-fakebasicauth2/index.html';
+
+plan tests => 3, need need_auth,
+                      need_module('mod_authn_anon'),
+                      need_min_apache_version(2.1);
+
+Apache::TestRequest::scheme('https');
+
+ok t_cmp (GET_RC($url, cert => undef),
+          500,
+          "Getting $url with no cert"
+         );
+
+ok t_cmp (GET_RC($url, cert => 'client_snakeoil'),
+          200,
+          "Getting $url with client_snakeoil cert"
+         );
+
+ok t_cmp (GET_RC($url, cert => 'client_ok'),
+          200,
+          "Getting $url with client_ok cert"
+         );

Reply via email to