-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Describe the bug
The API contains several API calls, e.g. user.find_user(login_or_email), which pass given parameters plain to the API, which can lead to problems if non-URL-safe characters are used. For example, passing an email address like test+2@example.com to user.find_user(login_or_email) results in the API call with URL /users/lookup?loginOrEmail=test+2@example.com, whereby the server interpretes the + as space.
To Reproduce
Steps to reproduce the behavior:
- Create a user with an email address containing a
+, e.g.,test+2@example.comvia the GUI. - Run API call
user.find_user(login_or_email="test+2@example.com"). - The user will not be returned (
grafana_client.client.GrafanaClientError: Client Error 404: user not found).
Expected behavior
A JSON response with the data of the user with that email address.
Versions
- Grafana: 12.3.1
grafana-client: 5.0.1- Authentication: [Basic]
Additional context
There are also other API calls missing encoding, such as user.search_users.
I would also offer to provide a Pull Request to fix this, if this is wanted by the project leads.