Skip to content

The Global API Key will be removed in OctoPrint 1.13.0 #70

@jacopotediosi

Description

@jacopotediosi

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions