Index: appengine/swarming/swarming_bot/config/bot_config.py |
diff --git a/appengine/swarming/swarming_bot/config/bot_config.py b/appengine/swarming/swarming_bot/config/bot_config.py |
index 5e4982b8ecce951f78894e55bf1e89cdb283880a..5ef94055e02f917a6b02d5334f9b5f35f8b02bde 100644 |
--- a/appengine/swarming/swarming_bot/config/bot_config.py |
+++ b/appengine/swarming/swarming_bot/config/bot_config.py |
@@ -63,6 +63,29 @@ def get_state(bot): |
return os_utilities.get_state() |
+def get_authentication_headers(bot): |
+ """Returns authentication headers and their expiration time. |
+ |
+ The returned headers will be passed with each HTTP request to the Swarming |
+ server (and only Swarming server). The bot will use the returned headers until |
+ they are close to expiration (usually 6 min, see AUTH_HEADERS_EXPIRATION_SEC |
+ in remote_client.py), and then it'll attempt to refresh them by calling |
+ get_authentication_headers again. |
+ |
+ Can be used to implement per-bot authentication. If no headers are returned, |
+ the server will use only IP whitelist for bot authentication. |
+ |
+ May be called by different threads, but never concurrently. |
+ |
+ Arguments: |
+ - botobj: bot.Bot instance. |
+ |
+ Returns: |
+ Tuple (dict with headers or None, unix timestamp of when they expire). |
+ """ |
+ return (None, None) |
+ |
+ |
### Hooks |