This PR implements enhancements discussed in #1, namely serving token as a JSON endpoint. It is meant to be a starting point for discussing the HTTP interface, specifically endpoints names and responses formats, so all the new code is placed into a separate file to avoid affecting any existing functionality.
Token generation runs independently from the webserver process, launching an update every 12 hours by default. Webserver uses port 8080 (configurable), with the latest token value being available on the /token endpoint:
Additionally, it is possible to initiate immediate unscheduled token generation by accessing /update endpoint. While handy for testing, this feature seems to add more complications than it's worth, so it probably should be removed, unless it finds some practical use.
This PR implements enhancements discussed in #1, namely serving token as a JSON endpoint. It is meant to be a starting point for discussing the HTTP interface, specifically endpoints names and responses formats, so all the new code is placed into a separate file to avoid affecting any existing functionality.
Token generation runs independently from the webserver process, launching an update every 12 hours by default. Webserver uses port
8080
(configurable), with the latest token value being available on the/token
endpoint:Additionally, it is possible to initiate immediate unscheduled token generation by accessing
/update
endpoint. While handy for testing, this feature seems to add more complications than it's worth, so it probably should be removed, unless it finds some practical use.