allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [01/16] git commit: [#1687] ticket:574 Skip https check during OAuth authentication process, when running tests
Date Wed, 04 Jun 2014 20:52:00 GMT
Repository: allura
Updated Branches:
  refs/heads/master cf55cdddb -> fd00be035


[#1687] ticket:574 Skip https check during OAuth authentication process, when running tests


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/4ce64a4b
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/4ce64a4b
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/4ce64a4b

Branch: refs/heads/master
Commit: 4ce64a4beff502a3e6bb9b6dceea0bb15d5daadd
Parents: 49f7e10
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri May 2 14:05:16 2014 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Tue Jun 3 15:27:21 2014 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/rest.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/4ce64a4b/Allura/allura/controllers/rest.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/rest.py b/Allura/allura/controllers/rest.py
index 85a6df1..3625032 100644
--- a/Allura/allura/controllers/rest.py
+++ b/Allura/allura/controllers/rest.py
@@ -106,7 +106,9 @@ class OAuthNegotiator(object):
     def _authenticate(self):
         if 'access_token' in request.params:
             # handle bearer tokens
-            if request.scheme != 'https':
+            # skip https check if auth invoked from tests
+            testing = request.environ.get('paste.testing', False)
+            if not testing and request.scheme != 'https':
                 request.environ['pylons.status_code_redirect'] = True
                 raise exc.HTTPForbidden
             access_token = M.OAuthAccessToken.query.get(


Mime
View raw message