| OLD | NEW |
| 1 # Copyright 2014 The LUCI Authors. All rights reserved. | 1 # Copyright 2014 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Integration with Cloud Endpoints. | 5 """Integration with Cloud Endpoints. |
| 6 | 6 |
| 7 This module is used only when 'endpoints' is importable (see auth/__init__.py). | 7 This module is used only when 'endpoints' is importable (see auth/__init__.py). |
| 8 """ | 8 """ |
| 9 | 9 |
| 10 import functools | 10 import functools |
| 11 import logging | 11 import logging |
| 12 | 12 |
| 13 import endpoints | 13 import endpoints |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 auth_context.current_identity = delegation.check_delegation_token( | 268 auth_context.current_identity = delegation.check_delegation_token( |
| 269 delegation_tok, auth_context.peer_identity) | 269 delegation_tok, auth_context.peer_identity) |
| 270 except delegation.BadTokenError as exc: | 270 except delegation.BadTokenError as exc: |
| 271 raise api.AuthorizationError('Bad delegation token: %s' % exc) | 271 raise api.AuthorizationError('Bad delegation token: %s' % exc) |
| 272 except delegation.TransientError as exc: | 272 except delegation.TransientError as exc: |
| 273 msg = 'Transient error while validating delegation token.\n%s' % exc | 273 msg = 'Transient error while validating delegation token.\n%s' % exc |
| 274 logging.error(msg) | 274 logging.error(msg) |
| 275 raise endpoints.InternalServerErrorException(msg) | 275 raise endpoints.InternalServerErrorException(msg) |
| 276 else: | 276 else: |
| 277 auth_context.current_identity = auth_context.peer_identity | 277 auth_context.current_identity = auth_context.peer_identity |
| OLD | NEW |