-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
This plugin uses the Global API Key, which has been deprecated for years and will be removed in OctoPrint 1.13.0:
| api_key = self.settings.global_get(["api", "key"]) |
It is recommended to replace it with the new Plugin API Key. Unlike the Global API Key, this is not a permanent token: a fresh key must be requested every time the plugin needs to perform an API call, by accessing self.plugin_apikey.
Plugins can easily fall back to the Global API Key in order to continue supporting older versions of OctoPrint, like this:
if hasattr(self, "plugin_apikey"):
api_key = self.plugin_apikey
else: # Fallback for OctoPrint versions < 1.12.0
api_key = self._settings.global_get(["api", "key"])Please note that the new Plugin API Key is still a Work In Progress: it was added with this PR, and will be included in OctoPrint 1.12.0, which has not yet been released. To test it, it is currently necessary to install OctoPrint from the dev branch.
Metadata
Metadata
Assignees
Labels
No labels