mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-27 03:54:01 +03:00
Merge branch 'master' of git://github.com/philipforget/django-rest-framework into philipforget-master
This commit is contained in:
commit
fac6d1a36e
|
@ -16,7 +16,7 @@ install:
|
||||||
- pip install $DJANGO
|
- pip install $DJANGO
|
||||||
- pip install defusedxml==0.3
|
- pip install defusedxml==0.3
|
||||||
- "if [[ ${TRAVIS_PYTHON_VERSION::1} != '3' ]]; then pip install oauth2==1.5.211; fi"
|
- "if [[ ${TRAVIS_PYTHON_VERSION::1} != '3' ]]; then pip install oauth2==1.5.211; fi"
|
||||||
- "if [[ ${TRAVIS_PYTHON_VERSION::1} != '3' ]]; then pip install django-oauth-plus==2.0; fi"
|
- "if [[ ${TRAVIS_PYTHON_VERSION::1} != '3' ]]; then pip install django-oauth-plus==2.2.1; fi"
|
||||||
- "if [[ ${TRAVIS_PYTHON_VERSION::1} != '3' ]]; then pip install django-oauth2-provider==0.2.4; fi"
|
- "if [[ ${TRAVIS_PYTHON_VERSION::1} != '3' ]]; then pip install django-oauth2-provider==0.2.4; fi"
|
||||||
- "if [[ ${TRAVIS_PYTHON_VERSION::1} != '3' ]]; then pip install django-guardian==1.1.1; fi"
|
- "if [[ ${TRAVIS_PYTHON_VERSION::1} != '3' ]]; then pip install django-guardian==1.1.1; fi"
|
||||||
- "if [[ ${DJANGO::11} == 'django==1.3' ]]; then pip install django-filter==0.5.4; fi"
|
- "if [[ ${DJANGO::11} == 'django==1.3' ]]; then pip install django-filter==0.5.4; fi"
|
||||||
|
|
|
@ -281,7 +281,8 @@ class OAuthAuthentication(BaseAuthentication):
|
||||||
"""
|
"""
|
||||||
Checks nonce of request, and return True if valid.
|
Checks nonce of request, and return True if valid.
|
||||||
"""
|
"""
|
||||||
return oauth_provider_store.check_nonce(request, oauth_request, oauth_request['oauth_nonce'])
|
return oauth_provider_store.check_nonce(request, oauth_request,
|
||||||
|
oauth_request['oauth_nonce'], oauth_request['oauth_timestamp'])
|
||||||
|
|
||||||
|
|
||||||
class OAuth2Authentication(BaseAuthentication):
|
class OAuth2Authentication(BaseAuthentication):
|
||||||
|
|
|
@ -362,7 +362,8 @@ class OAuthTests(TestCase):
|
||||||
def test_post_form_with_urlencoded_parameters(self):
|
def test_post_form_with_urlencoded_parameters(self):
|
||||||
"""Ensure POSTing with x-www-form-urlencoded auth parameters passes"""
|
"""Ensure POSTing with x-www-form-urlencoded auth parameters passes"""
|
||||||
params = self._create_authorization_url_parameters()
|
params = self._create_authorization_url_parameters()
|
||||||
response = self.csrf_client.post('/oauth/', params)
|
auth = self._create_authorization_header()
|
||||||
|
response = self.csrf_client.post('/oauth/', params, HTTP_AUTHORIZATION=auth)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
@unittest.skipUnless(oauth_provider, 'django-oauth-plus not installed')
|
@unittest.skipUnless(oauth_provider, 'django-oauth-plus not installed')
|
||||||
|
@ -424,7 +425,8 @@ class OAuthTests(TestCase):
|
||||||
read_write_access_token.resource.is_readonly = False
|
read_write_access_token.resource.is_readonly = False
|
||||||
read_write_access_token.resource.save()
|
read_write_access_token.resource.save()
|
||||||
params = self._create_authorization_url_parameters()
|
params = self._create_authorization_url_parameters()
|
||||||
response = self.csrf_client.post('/oauth-with-scope/', params)
|
auth = self._create_authorization_header()
|
||||||
|
response = self.csrf_client.post('/oauth-with-scope/', params, HTTP_AUTHORIZATION=auth)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
@unittest.skipUnless(oauth_provider, 'django-oauth-plus not installed')
|
@unittest.skipUnless(oauth_provider, 'django-oauth-plus not installed')
|
||||||
|
|
16
tox.ini
16
tox.ini
|
@ -22,7 +22,7 @@ basepython = python2.7
|
||||||
deps = Django==1.6
|
deps = Django==1.6
|
||||||
django-filter==0.6a1
|
django-filter==0.6a1
|
||||||
defusedxml==0.3
|
defusedxml==0.3
|
||||||
django-oauth-plus==2.0
|
django-oauth-plus==2.2.1
|
||||||
oauth2==1.5.211
|
oauth2==1.5.211
|
||||||
django-oauth2-provider==0.2.4
|
django-oauth2-provider==0.2.4
|
||||||
django-guardian==1.1.1
|
django-guardian==1.1.1
|
||||||
|
@ -32,7 +32,7 @@ basepython = python2.6
|
||||||
deps = Django==1.6
|
deps = Django==1.6
|
||||||
django-filter==0.6a1
|
django-filter==0.6a1
|
||||||
defusedxml==0.3
|
defusedxml==0.3
|
||||||
django-oauth-plus==2.0
|
django-oauth-plus==2.2.1
|
||||||
oauth2==1.5.211
|
oauth2==1.5.211
|
||||||
django-oauth2-provider==0.2.4
|
django-oauth2-provider==0.2.4
|
||||||
django-guardian==1.1.1
|
django-guardian==1.1.1
|
||||||
|
@ -54,7 +54,7 @@ basepython = python2.7
|
||||||
deps = django==1.5.5
|
deps = django==1.5.5
|
||||||
django-filter==0.6a1
|
django-filter==0.6a1
|
||||||
defusedxml==0.3
|
defusedxml==0.3
|
||||||
django-oauth-plus==2.0
|
django-oauth-plus==2.2.1
|
||||||
oauth2==1.5.211
|
oauth2==1.5.211
|
||||||
django-oauth2-provider==0.2.3
|
django-oauth2-provider==0.2.3
|
||||||
django-guardian==1.1.1
|
django-guardian==1.1.1
|
||||||
|
@ -64,7 +64,7 @@ basepython = python2.6
|
||||||
deps = django==1.5.5
|
deps = django==1.5.5
|
||||||
django-filter==0.6a1
|
django-filter==0.6a1
|
||||||
defusedxml==0.3
|
defusedxml==0.3
|
||||||
django-oauth-plus==2.0
|
django-oauth-plus==2.2.1
|
||||||
oauth2==1.5.211
|
oauth2==1.5.211
|
||||||
django-oauth2-provider==0.2.3
|
django-oauth2-provider==0.2.3
|
||||||
django-guardian==1.1.1
|
django-guardian==1.1.1
|
||||||
|
@ -74,7 +74,7 @@ basepython = python2.7
|
||||||
deps = django==1.4.10
|
deps = django==1.4.10
|
||||||
django-filter==0.6a1
|
django-filter==0.6a1
|
||||||
defusedxml==0.3
|
defusedxml==0.3
|
||||||
django-oauth-plus==2.0
|
django-oauth-plus==2.2.1
|
||||||
oauth2==1.5.211
|
oauth2==1.5.211
|
||||||
django-oauth2-provider==0.2.3
|
django-oauth2-provider==0.2.3
|
||||||
django-guardian==1.1.1
|
django-guardian==1.1.1
|
||||||
|
@ -84,7 +84,7 @@ basepython = python2.6
|
||||||
deps = django==1.4.10
|
deps = django==1.4.10
|
||||||
django-filter==0.6a1
|
django-filter==0.6a1
|
||||||
defusedxml==0.3
|
defusedxml==0.3
|
||||||
django-oauth-plus==2.0
|
django-oauth-plus==2.2.1
|
||||||
oauth2==1.5.211
|
oauth2==1.5.211
|
||||||
django-oauth2-provider==0.2.3
|
django-oauth2-provider==0.2.3
|
||||||
django-guardian==1.1.1
|
django-guardian==1.1.1
|
||||||
|
@ -94,7 +94,7 @@ basepython = python2.7
|
||||||
deps = django==1.3.5
|
deps = django==1.3.5
|
||||||
django-filter==0.5.4
|
django-filter==0.5.4
|
||||||
defusedxml==0.3
|
defusedxml==0.3
|
||||||
django-oauth-plus==2.0
|
django-oauth-plus==2.2.1
|
||||||
oauth2==1.5.211
|
oauth2==1.5.211
|
||||||
django-oauth2-provider==0.2.3
|
django-oauth2-provider==0.2.3
|
||||||
django-guardian==1.1.1
|
django-guardian==1.1.1
|
||||||
|
@ -104,7 +104,7 @@ basepython = python2.6
|
||||||
deps = django==1.3.5
|
deps = django==1.3.5
|
||||||
django-filter==0.5.4
|
django-filter==0.5.4
|
||||||
defusedxml==0.3
|
defusedxml==0.3
|
||||||
django-oauth-plus==2.0
|
django-oauth-plus==2.2.1
|
||||||
oauth2==1.5.211
|
oauth2==1.5.211
|
||||||
django-oauth2-provider==0.2.3
|
django-oauth2-provider==0.2.3
|
||||||
django-guardian==1.1.1
|
django-guardian==1.1.1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user