Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: third_party/gsutil/cloudauth/oauth2_plugin.py

Issue 10199002: Upgrade gsutil to 3.4 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/gsutil/cloudauth/cloudauth.py ('k') | third_party/gsutil/cloudreader/README.google » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2011 Google Inc. 1 # Copyright 2011 Google Inc.
2 # 2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); 3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License. 4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at 5 # You may obtain a copy of the License at
6 # 6 #
7 # http://www.apache.org/licenses/LICENSE-2.0 7 # http://www.apache.org/licenses/LICENSE-2.0
8 # 8 #
9 # Unless required by applicable law or agreed to in writing, software 9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, 10 # distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 24 matching lines...) Expand all
35 if provider.name != 'google': 35 if provider.name != 'google':
36 raise NotReadyToAuthenticate() 36 raise NotReadyToAuthenticate()
37 37
38 def add_auth(self, http_request): 38 def add_auth(self, http_request):
39 user = users.get_current_user() 39 user = users.get_current_user()
40 credentials = StorageByKeyName( 40 credentials = StorageByKeyName(
41 Credentials, user.user_id(), 'credentials').get() 41 Credentials, user.user_id(), 'credentials').get()
42 if not credentials or credentials.invalid: 42 if not credentials or credentials.invalid:
43 raise NotReadyToAuthenticate() 43 raise NotReadyToAuthenticate()
44 http_request.headers['Authorization'] = ( 44 http_request.headers['Authorization'] = (
45 'OAuth %s' % str(credentials.access_token)) 45 'Bearer %s' % str(credentials.access_token))
OLDNEW
« no previous file with comments | « third_party/gsutil/cloudauth/cloudauth.py ('k') | third_party/gsutil/cloudreader/README.google » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698