Store some metadata with system tokens so it's easier to filter and
distinguish them.
@@ -291,7 +291,13 @@ class ProcessSensorContainer(object):
# Include full api URL and API token specific to that sensor
ttl = (24 * 60 * 60)
- temporary_token = create_token(username='sensors_container', ttl=ttl, service=True)
+ metadata = {
+ 'service': 'sensors_container',
+ 'sensor_path': sensor['file_path'],
+ 'sensor_class': sensor['class_name']
+ }
+ temporary_token = create_token(username='sensors_container', ttl=ttl, metadata=metadata,
+ service=True)
env[API_URL_ENV_VARIABLE_NAME] = get_full_public_api_url()
env[AUTH_TOKEN_ENV_VARIABLE_NAME] = temporary_token.token
