Skip to content

Commit

Permalink
Merge tag '18.0.3' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
felliott committed Feb 1, 2019
2 parents 93b3576 + a0038c1 commit 2cc62a1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
ChangeLog
*********

18.0.3 (2019-01-31)
===================
- Fix: Send metadata about request to the OSF auth endpoint to help OSF distinguish file views from
downloads. (thanks, @Johnetordoff!)

18.0.2 (2018-12-14)
===================
- Fix: Get CI running again by adding workaround for bad TravisCI/Boto interaction. See:
Expand Down
20 changes: 16 additions & 4 deletions tests/auth/osf/test_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,29 @@ async def test_permissions_post_copy_source_destination(self):
await self.handler.get(resource, provider, self.request, action=action, auth_type=auth_type)
if auth_type is AuthType.SOURCE:
self.handler.build_payload.assert_called_with({
'nid': resource,
'provider': provider,
'nid': 'test',
'provider': 'test',
'action': 'download',
'path': '',
'version': None,
'metrics': {
'referrer': None,
'origin': None,
'uri': settings.API_URL,
'user_agent': None
}
}, cookie=None, view_only=None)
else:
self.handler.build_payload.assert_called_with({
'nid': resource,
'provider': provider,
'nid': 'test',
'provider': 'test',
'action': 'upload',
'path': '',
'version': None,
'metrics': {
'referrer': None,
'origin': None,
'uri': settings.API_URL,
'user_agent': None
}
}, cookie=None, view_only=None)
6 changes: 6 additions & 0 deletions waterbutler/auth/osf/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ async def get(self, resource, provider, request, action=None, auth_type=AuthType
'action': osf_action,
'path': path,
'version': version,
'metrics': {
'referrer': request.headers.get('Referer'),
'user_agent': request.headers.get('User-Agent'),
'origin': request.headers.get('Origin'),
'uri': request.uri,
}
}, cookie=cookie, view_only=view_only),
headers,
dict(request.cookies)
Expand Down
2 changes: 1 addition & 1 deletion waterbutler/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '18.0.2'
__version__ = '18.0.3'

0 comments on commit 2cc62a1

Please sign in to comment.