You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2018/01/05 00:12:08 UTC

[whimsy] branch master updated: Allow override of user in test mode

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 <se...@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" <co...@whimsical.apache.org>'].