You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/02/25 16:33:27 UTC
[28/28] allura git commit: [#7832] ticket:740 Format auth header
according to spec
[#7832] ticket:740 Format auth header according to spec
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/d07d77d5
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d07d77d5
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d07d77d5
Branch: refs/heads/ib/7832
Commit: d07d77d56c130a9c129576eee8b0a0f884d78ea5
Parents: 2b4e30e
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Feb 25 14:21:58 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Feb 25 14:21:58 2015 +0000
----------------------------------------------------------------------
Allura/allura/controllers/rest.py | 2 +-
Allura/allura/tests/functional/test_rest.py | 6 +++---
AlluraTest/alluratest/controller.py | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/d07d77d5/Allura/allura/controllers/rest.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/rest.py b/Allura/allura/controllers/rest.py
index ab21649..8eafa30 100644
--- a/Allura/allura/controllers/rest.py
+++ b/Allura/allura/controllers/rest.py
@@ -107,7 +107,7 @@ class OAuthNegotiator(object):
return result
def _authenticate(self):
- bearer_token_prefix = 'OAuth BearerToken access_token='
+ bearer_token_prefix = 'Bearer '
auth = request.headers.get('Authorization')
if auth and auth.startswith(bearer_token_prefix):
access_token = auth[len(bearer_token_prefix):]
http://git-wip-us.apache.org/repos/asf/allura/blob/d07d77d5/Allura/allura/tests/functional/test_rest.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_rest.py b/Allura/allura/tests/functional/test_rest.py
index fca1078..43a92d1 100644
--- a/Allura/allura/tests/functional/test_rest.py
+++ b/Allura/allura/tests/functional/test_rest.py
@@ -92,7 +92,7 @@ class TestRestHome(TestRestApiBase):
@mock.patch('allura.controllers.rest.request')
def test_bearer_token_non_bearer_via_headers(self, request, OAuthAccessToken):
request.headers = {
- 'Authorization': 'OAuth BearerToken access_token=foo'
+ 'Authorization': 'Bearer foo'
}
request.scheme = 'https'
self._patch_token(OAuthAccessToken)
@@ -106,7 +106,7 @@ class TestRestHome(TestRestApiBase):
@mock.patch('allura.controllers.rest.request')
def test_bearer_token_invalid_via_headers(self, request, OAuthAccessToken):
request.headers = {
- 'Authorization': 'OAuth BearerToken access_token=foo'
+ 'Authorization': 'Bearer foo'
}
request.scheme = 'https'
self._patch_token(OAuthAccessToken)
@@ -138,7 +138,7 @@ class TestRestHome(TestRestApiBase):
ThreadLocalODMSession.flush_all()
token = access_token.api_key
request.headers = {
- 'Authorization': 'OAuth BearerToken access_token={}'.format(token)
+ 'Authorization': 'Bearer {}'.format(token)
}
request.scheme = 'https'
r = self.api_post('/rest/p/test/wiki', access_token='foo')
http://git-wip-us.apache.org/repos/asf/allura/blob/d07d77d5/AlluraTest/alluratest/controller.py
----------------------------------------------------------------------
diff --git a/AlluraTest/alluratest/controller.py b/AlluraTest/alluratest/controller.py
index c64ea5f..0f13c5d 100644
--- a/AlluraTest/alluratest/controller.py
+++ b/AlluraTest/alluratest/controller.py
@@ -224,7 +224,7 @@ class TestRestApiBase(TestController):
token = self.token(user).api_key
headers = {
- 'Authorization': 'OAuth BearerToken access_token={}'.format(token)
+ 'Authorization': 'Bearer {}'.format(token)
}
fn = getattr(self.app, method.lower())