Skip to content

Commit

Permalink
Chore: A bit more maintenance (#134)
Browse files Browse the repository at this point in the history
* Set `User-Agent` HTTP header like `grafana-wtf/0.18.0`
* Chore: Update to Pygments>=2.15.1, because CVE-2022-40896
  -- https://nvd.nist.gov/vuln/detail/CVE-2022-40896
* Update backlog
  • Loading branch information
amotl authored Mar 31, 2024
1 parent 33b3a96 commit 5eabef0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ in progress
behaviour. Thanks, @JensRichnow and @JWCook.
- Improve error reporting and exit behavior when connecting to Grafana
instance fails. Thanks, @interfan7.
- Set ``User-Agent`` HTTP header like ``grafana-wtf/0.18.0``

2024-03-07 0.18.0
=================
Expand Down
4 changes: 2 additions & 2 deletions doc/backlog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ Iteration +1

- https://swarm.hiveeyes.org/grafana/dashboards/f/ODVFg50mz/arnas
- https://swarm.hiveeyes.org/grafana/dashboards/f/VM-KxXvWk/ruhrgebiet
- [o] Does it croak on play.grafana.org?
- [o] Why are there two newlines on stdout output?
- [o] Query dashboard edit history by dashboard tag(s)
- [o] Set user agent to ``grafana-wtf``


************
Expand Down Expand Up @@ -94,3 +92,5 @@ Done
- [x] Add JSON and YAML output formats for ``find`` subcommand
- [x] History: Group edits by dashboard, to be able to count them
- [x] History: Add a feature to filter dashboards by ``COUNT(edits) = 1``
- [x] Does it croak on play.grafana.org? No.
- [x] Set user agent to ``grafana-wtf``
5 changes: 3 additions & 2 deletions grafana_wtf/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from tqdm.contrib.logging import tqdm_logging_redirect
from urllib3.exceptions import InsecureRequestWarning

from grafana_wtf import __appname__
from grafana_wtf import __appname__, __version__
from grafana_wtf.model import (
DashboardDetails,
DashboardExplorationItem,
Expand Down Expand Up @@ -103,7 +103,8 @@ def grafana_client_factory(cls, grafana_url, grafana_token=None):
verify=verify,
)
if cls.session:
cls.session.headers["User-Agent"] = grafana.client.user_agent
user_agent = f"{__appname__}/{__version__}"
cls.session.headers["User-Agent"] = user_agent
grafana.client.s = cls.session

return grafana
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# Output
"tabulate>=0.8.5,<0.10",
"colored>=1.4.3,<3",
"Pygments>=2.7.4,<3",
"Pygments>=2.15.1,<3",
"PyYAML>=5,<7",
]

Expand Down

0 comments on commit 5eabef0

Please sign in to comment.