diff --git a/changelogs/fragments/376-dashboard-lookup-api-key-deprecation.yml b/changelogs/fragments/376-dashboard-lookup-api-key-deprecation.yml new file mode 100644 index 00000000..a462ffd3 --- /dev/null +++ b/changelogs/fragments/376-dashboard-lookup-api-key-deprecation.yml @@ -0,0 +1,3 @@ +--- +removed_features: + - removed check and handling of mangled api key in `grafana_dashboard` lookup diff --git a/plugins/lookup/grafana_dashboard.py b/plugins/lookup/grafana_dashboard.py index 83ee250f..514d4fd5 100644 --- a/plugins/lookup/grafana_dashboard.py +++ b/plugins/lookup/grafana_dashboard.py @@ -152,16 +152,8 @@ def grafana_switch_organisation(self, headers): def grafana_headers(self): headers = {"content-type": "application/json; charset=utf8"} - if self.grafana_api_key: - api_key = self.grafana_api_key - if len(api_key) % 4 == 2: - display.deprecated( - "Passing a mangled version of the API key to the grafana_dashboard lookup is no longer necessary and should not be done.", - "2.0.0", - collection_name="community.grafana", - ) - api_key += "==" - headers["Authorization"] = "Bearer %s" % api_key + if self.grafana_api_key.get("grafana_api_key", None): + headers["Authorization"] = "Bearer %s" % self.grafana_api_key else: headers["Authorization"] = basic_auth_header( self.grafana_user, self.grafana_password