| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from google.appengine.api.app_identity import app_identity | 5 from google.appengine.api.app_identity import app_identity |
| 6 | 6 |
| 7 | 7 |
| 8 _EMAIL_SCOPE = 'https://www.googleapis.com/auth/userinfo.email' | 8 _EMAIL_SCOPE = 'https://www.googleapis.com/auth/userinfo.email' |
| 9 | 9 |
| 10 | 10 |
| 11 def GetAuthToken(): # pragma: no cover | 11 def GetAuthToken(scope=_EMAIL_SCOPE): # pragma: no cover |
| 12 """Gets auth token for requests to swarming server and isolated server.""" | 12 """Gets auth token for requests to hosts that need authorizations.""" |
| 13 auth_token, _ = app_identity.get_access_token(_EMAIL_SCOPE) | 13 auth_token, _ = app_identity.get_access_token(scope) |
| 14 return auth_token | 14 return auth_token |
| OLD | NEW |