grafana/docs/sources/http_api
Sofia Papagiannaki dc9ec7dc91
Auth: Allow expiration of API keys (#17678)
* Modify backend to allow expiration of API Keys

* Add middleware test for expired api keys

* Modify frontend to enable expiration of API Keys

* Fix frontend tests

* Fix migration and add index for `expires` field

* Add api key tests for database access

* Substitude time.Now() by a mock for test usage

* Front-end modifications

* Change input label to `Time to live`
* Change input behavior to comply with the other similar
* Add tooltip

* Modify AddApiKey api call response

Expiration should be *time.Time instead of string

* Present expiration date in the selected timezone

* Use kbn for transforming intervals to seconds

* Use `assert` library for tests

* Frontend fixes

Add checks for empty/undefined/null values

* Change expires column from datetime to integer

* Restrict api key duration input

It should be interval not number

* AddApiKey must complain if SecondsToLive is negative

* Declare ErrInvalidApiKeyExpiration

* Move configuration to auth section

* Update docs

* Eliminate alias for models in modified files

* Omit expiration from api response if empty

* Eliminate Goconvey from test file

* Fix test

Do not sleep, use mocked timeNow() instead

* Remove index for expires from api_key table

The index should be anyway on both org_id and expires fields.
However this commit eliminates completely the index for now
since not many rows are expected to be in this table.

* Use getTimeZone function

* Minor change in api key listing

The frontend should display a message instead of empty string
if the key does not expire.
2019-06-26 09:47:03 +03:00
..
_index.md Chore: Hugo upgrade (#17494) 2019-06-12 08:01:44 +02:00
admin.md Feature: Parse user agent string in user auth token api response (#16… (#17504) 2019-06-11 14:12:52 +02:00
alerting_notification_channels.md docs: remove my email from docs examples (#17325) 2019-05-28 16:02:14 +02:00
alerting.md Alerting: Notification channel http api enhancements (#16219) 2019-03-26 18:37:02 +07:00
annotations.md Docs: Clarifies from which version the Patch VERB is available (#17532) 2019-06-12 11:14:30 +02:00
auth.md Auth: Allow expiration of API keys (#17678) 2019-06-26 09:47:03 +03:00
dashboard_permissions.md Update dashboard_permissions.md 2018-05-11 10:19:28 +08:00
dashboard_versions.md docs: fix minor typos 2018-10-06 17:09:41 +02:00
dashboard.md Update dashboard.md 2018-08-11 23:44:15 -07:00
data_source.md Docs: Fix grammar in docs (#17233) 2019-05-22 17:54:08 +02:00
datasource_permissions.md Chore: Hugo upgrade (#17494) 2019-06-12 08:01:44 +02:00
external_group_sync.md Chore: Hugo upgrade (#17494) 2019-06-12 08:01:44 +02:00
folder_dashboard_search.md docs: clarify page parameter version support for folder/dashboard search (#16836) 2019-05-01 11:42:03 +02:00
folder_permissions.md Fixed Syntax for folder permission's JSON 2019-01-14 10:53:16 -05:00
folder.md Fix typo 2018-08-11 23:42:31 -07:00
org.md docs/*: Fix misspell issues 2018-11-29 18:14:20 +01:00
other.md Document /api/health 2019-01-25 17:52:28 +01:00
playlist.md docs: fixes and update current version 2019-04-09 17:30:21 +02:00
preferences.md Update codebox (#9430) 2017-10-05 19:01:03 +02:00
snapshot.md Fix dashboard snapshot deletion (#12025) 2018-05-24 08:55:16 +02:00
team.md docs: team http api update 2018-11-14 17:59:32 +01:00
user.md Feature: Parse user agent string in user auth token api response (#16… (#17504) 2019-06-11 14:12:52 +02:00