Docs: /sources/http_api/user.md (#31152)

I believe it's a mistake in the docs, since http requests against those endpoints are not supposed to be authenticated with API keys. 

If I correctly understand Grafana's auth design, the API key is not issued/tied to a user, therefore there is no mechanism to detect who the user is when the request is authenticated with an API key.

Please note there may be other endpoints like this...
This commit is contained in:
Alexander Tymchuk 2021-03-26 20:15:10 +03:00 committed by GitHub
parent 96ca2d6afc
commit 3efca53edf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -298,9 +298,11 @@ Content-Type: application/json
GET /api/user HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
Authorization: Basic YWRtaW46YWRtaW4=
```
Requires basic authentication.
**Example Response**:
```http
@ -328,7 +330,7 @@ Content-Type: application/json
`PUT /api/user/password`
Changes the password for the user
Changes the password for the user. Requires basic authentication.
**Example Request**:
@ -336,7 +338,7 @@ Changes the password for the user
PUT /api/user/password HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
Authorization: Basic YWRtaW46YWRtaW4=
{
"oldPassword": "old_password",
@ -415,7 +417,7 @@ Content-Type: application/json
`GET /api/user/orgs`
Return a list of all organizations of the current user.
Return a list of all organizations of the current user. Requires basic authentication.
**Example Request**:
@ -423,7 +425,7 @@ Return a list of all organizations of the current user.
GET /api/user/orgs HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
Authorization: Basic YWRtaW46YWRtaW4=
```
**Example Response**: