RSS allow access via token (#310)

Allow access via a token
* New RSS URL
* Redirect the old RSS feed URL
* fix tests
This commit is contained in:
dgtlmoon
2021-12-16 00:05:01 +01:00
committed by GitHub
parent e71dbbe771
commit 9815fc2526
4 changed files with 78 additions and 38 deletions

View File

@@ -49,7 +49,7 @@ class ChangeDetectionStore:
# Custom notification content
'notification_title': None,
'notification_body': None,
'notification_format': None,
'notification_format': None
}
}
}
@@ -147,6 +147,12 @@ class ChangeDetectionStore:
else:
self.__data['app_guid'] = str(uuid_builder.uuid4())
# Generate the URL access token for RSS feeds
if not 'rss_access_token' in self.__data['settings']['application']:
import secrets
secret = secrets.token_hex(16)
self.__data['settings']['application']['rss_access_token'] = secret
self.needs_write = True
# Finally start the thread that will manage periodic data saves to JSON