whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Allow override of user in test mode
Date Fri, 05 Jan 2018 00:12:08 GMT
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 7a49ed2  Allow override of user in test mode
7a49ed2 is described below

commit 7a49ed2a2acfb290a9bd12f5fea6521b8d35699f
Author: Sebb <sebb@apache.org>
AuthorDate: Fri Jan 5 00:11:43 2018 +0000

    Allow override of user in test mode
---
 www/status/passenger.cgi | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/www/status/passenger.cgi b/www/status/passenger.cgi
index e884c4d..a08a2e5 100755
--- a/www/status/passenger.cgi
+++ b/www/status/passenger.cgi
@@ -8,7 +8,12 @@ require 'open3'
 require 'wunderbar'
 require 'whimsy/asf'
 
-user = ASF::LDAP.http_auth(ENV['HTTP_AUTHORIZATION'])
+# 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"

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message