Skip to content

Commit 5eabef0

Browse files
authored
Chore: A bit more maintenance (#134)
* 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
1 parent 33b3a96 commit 5eabef0

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ in progress
1616
behaviour. Thanks, @JensRichnow and @JWCook.
1717
- Improve error reporting and exit behavior when connecting to Grafana
1818
instance fails. Thanks, @interfan7.
19+
- Set ``User-Agent`` HTTP header like ``grafana-wtf/0.18.0``
1920

2021
2024-03-07 0.18.0
2122
=================

doc/backlog.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ Iteration +1
1010

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

1816

1917
************
@@ -94,3 +92,5 @@ Done
9492
- [x] Add JSON and YAML output formats for ``find`` subcommand
9593
- [x] History: Group edits by dashboard, to be able to count them
9694
- [x] History: Add a feature to filter dashboards by ``COUNT(edits) = 1``
95+
- [x] Does it croak on play.grafana.org? No.
96+
- [x] Set user agent to ``grafana-wtf``

grafana_wtf/core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from tqdm.contrib.logging import tqdm_logging_redirect
2222
from urllib3.exceptions import InsecureRequestWarning
2323

24-
from grafana_wtf import __appname__
24+
from grafana_wtf import __appname__, __version__
2525
from grafana_wtf.model import (
2626
DashboardDetails,
2727
DashboardExplorationItem,
@@ -103,7 +103,8 @@ def grafana_client_factory(cls, grafana_url, grafana_token=None):
103103
verify=verify,
104104
)
105105
if cls.session:
106-
cls.session.headers["User-Agent"] = grafana.client.user_agent
106+
user_agent = f"{__appname__}/{__version__}"
107+
cls.session.headers["User-Agent"] = user_agent
107108
grafana.client.s = cls.session
108109

109110
return grafana

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# Output
2727
"tabulate>=0.8.5,<0.10",
2828
"colored>=1.4.3,<3",
29-
"Pygments>=2.7.4,<3",
29+
"Pygments>=2.15.1,<3",
3030
"PyYAML>=5,<7",
3131
]
3232

0 commit comments

Comments
 (0)