This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 71cb4ef0 Not useful to general public
71cb4ef0 is described below

commit 71cb4ef0a7bb7ff5ea3c1cab3e9b8798f513bcd5
Author: Sebb <s...@apache.org>
AuthorDate: Wed Jan 24 00:08:42 2024 +0000

    Not useful to general public
---
 www/status/index.cgi |  2 +-
 www/status/svn.cgi   | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/www/status/index.cgi b/www/status/index.cgi
index 238bed83..e6dc5a88 100755
--- a/www/status/index.cgi
+++ b/www/status/index.cgi
@@ -92,7 +92,7 @@ print <<-EOF
       <li><a href="../member/logs">Apache HTTPD error logs</a>
         (ASF member only)</li>
       <li><a href="passenger">Passenger</a> (ASF committer only)</li>
-      <li><a href="svn">Subversion</a></li>
+      <li><a href="svn">Subversion</a> (ASF committer only)</li>
       <li>Git code info: #{git_info}</li>
       <li>Git repo info: #{git_repo}</li>
     </ul>
diff --git a/www/status/svn.cgi b/www/status/svn.cgi
index ee6bf2e5..e95ec93d 100755
--- a/www/status/svn.cgi
+++ b/www/status/svn.cgi
@@ -9,6 +9,19 @@ $LOAD_PATH.unshift '/srv/whimsy/lib'
 require 'wunderbar/bootstrap'
 require 'whimsy/asf'
 
+# Allow override of user in test mode
+if ENV['RACK_ENV'] == 'test'
+  user = ASF::Person[ENV['USER']]
+else
+  user = ASF::LDAP.http_auth(ENV['HTTP_AUTHORIZATION'])
+end
+
+unless user
+print "Status: 401 Unauthorized\r\n"
+print "WWW-Authenticate: Basic realm=\"ASF Members and Officers\"\r\n\r\n"
+exit
+end
+
 # load list of repositories
 repository = ASF::SVN.repo_entries
 

Reply via email to