Skip to content

Commit

Permalink
fix: remove deprecation check for api_key version
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemental committed May 31, 2024
1 parent fff9558 commit 6d3dcde
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions plugins/lookup/grafana_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,10 @@ 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 module.params.get("grafana_api_key", None):
self.headers["Authorization"] = (
"Bearer %s" % module.params["grafana_api_key"]
)
else:
headers["Authorization"] = basic_auth_header(
self.grafana_user, self.grafana_password
Expand Down

0 comments on commit 6d3dcde

Please sign in to comment.