| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The LUCI Authors. All rights reserved. | 2 # Copyright 2014 The LUCI Authors. All rights reserved. |
| 3 # Use of this source code is governed by the Apache v2.0 license that can be | 3 # Use of this source code is governed under the Apache License, Version 2.0 |
| 4 # found in the LICENSE file. | 4 # that can be found in the LICENSE file. |
| 5 | 5 |
| 6 """Tools to control application running via dev_appserver.py. | 6 """Tools to control application running via dev_appserver.py. |
| 7 | 7 |
| 8 Useful for smoke and integration tests. | 8 Useful for smoke and integration tests. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import collections | 11 import collections |
| 12 import cookielib | 12 import cookielib |
| 13 import ctypes | 13 import ctypes |
| 14 import json | 14 import json |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 | 299 |
| 300 It only works with apps that use 'auth' component. | 300 It only works with apps that use 'auth' component. |
| 301 """ | 301 """ |
| 302 if self._xsrf_token is None: | 302 if self._xsrf_token is None: |
| 303 resp = self.json_request( | 303 resp = self.json_request( |
| 304 '/auth/api/v1/accounts/self/xsrf_token', | 304 '/auth/api/v1/accounts/self/xsrf_token', |
| 305 body={}, | 305 body={}, |
| 306 headers={'X-XSRF-Token-Request': '1'}) | 306 headers={'X-XSRF-Token-Request': '1'}) |
| 307 self._xsrf_token = resp.body['xsrf_token'].encode('ascii') | 307 self._xsrf_token = resp.body['xsrf_token'].encode('ascii') |
| 308 return self._xsrf_token | 308 return self._xsrf_token |
| OLD | NEW |