mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
API keys: Return 410 Gone status from POST /auth/keys endpoint (#92965)
* return 410 Gone status from POST /auth/keys endpoint * generate swagger * remove postAPIkeyResponse * re-generate swagger * remove docs for api key creation endpoint
This commit is contained in:
@@ -89,47 +89,13 @@ Endpoint is obsolete and has been moved to [Grafana service account API]({{< rel
|
||||
{{% admonition type="warning" %}}
|
||||
|
||||
### DEPRECATED
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||||
|
||||
```
|
||||
|
||||
JSON Body schema:
|
||||
|
||||
- **name** – The key name
|
||||
- **role** – Sets the access level/Grafana Role for the key. Can be one of the following values: `None`, `Viewer`, `Editor` or `Admin`.
|
||||
- **secondsToLive** – Sets the key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will never expire.
|
||||
|
||||
Error statuses:
|
||||
|
||||
- **400** – `api_key_max_seconds_to_live` is set but no `secondsToLive` is specified or `secondsToLive` is greater than this value.
|
||||
- **500** – The key was unable to be stored in the database.
|
||||
|
||||
**Example Response**:
|
||||
|
||||
```http
|
||||
HTTP/1.1 301
|
||||
Content-Type: application/json
|
||||
|
||||
```
|
||||
|
||||
## Delete API Key
|
||||
|
||||
{{% admonition type="warning" %}}
|
||||
|
||||
### DEPRECATED
|
||||
|
||||
{{% /admonition %}}
|
||||
|
||||
`DELETE /api/auth/keys/:id`
|
||||
|
||||
|
||||
{{% /admonition %}}
|
||||
|
||||
|
||||
`DELETE /api/auth/keys/:id`
|
||||
|
||||
**Required permissions**
|
||||
| `apikeys:delete` | apikeys:\* |
|
||||
|
||||
See note in the [introduction]({{< ref "#authentication-api" >}}) for an explanation.
|
||||
|
||||
| Action | Scope |
|
||||
|
||||
Reference in New Issue
Block a user