Commit Graph

7280 Commits

Author SHA1 Message Date
J Guerreiro
cb6e5ae8ce
AccessControl: Add access control actions and scopes to team update and delete
* AccessControl: Add access control actions and scopes to team update and delete

* AccessControl: Add tests for AC guards in update/delete

* AccessControl: add fixed role for team writer

* AccessControl: ensure team related AC is deleted with team

* Update pkg/api/team_test.go
2022-01-27 16:16:44 +01:00
Tania B
1a9c293984
Chore: Remove unused AWS KMS provider's token setting (#44531) 2022-01-27 17:15:49 +02:00
Santiago
1bed84ea56
Fix InfluxDB unhealthy alerts and false "no data"s (#43441)
* check for TimeSeriesTypeNot to fix InfluxDB alerts

* log a warning when a data frame is ignored
2022-01-27 10:53:27 -03:00
Gabriel MABILLE
41c8db16ee
Accesscontrol: Feature does not need a license (#44517) 2022-01-27 13:43:12 +01:00
Karl Persson
bf63ccbe00
Access control: Rewrite access control SQL filter (#44488)
* Rewrite access control sql filter
2022-01-27 13:06:08 +01:00
Gábor Farkas
b42161a713
Loki: add from JSON to dataframes tests (#44375)
* Loki: add from JSON to dataframes tests

* fixed wrong content-type

* added -Inf test-case
2022-01-27 12:43:44 +01:00
idafurjes
82892331c1
Chore: Remove bus from signup and playlist api (#44485)
* Remove bus from signup and playlist api

* Remove bus from playlist play
2022-01-27 10:33:02 +01:00
Artur Wierzbicki
5148250366
Rendering service - add optional RenderingSession (#44098)
* rendering service changes:
- make node-renderer request timeout configurable
- introduce optional RenderingSession providing a long-lived session key

* remove console logs

* added comment explaining empty "afterRequest" method

* fix compilation error

* update imports formatting

* Update pkg/services/rendering/interface.go

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update pkg/services/rendering/rendering.go

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* review fix: extract renderKey related functions/structs to auth.go

* #44449: private'd `rendering.getRequestTimeout`

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
2022-01-27 02:02:19 +04:00
Ryan McKinley
3c334cd8ba
Logger: avoid panic when time is a string (not fmt.Stringer) (#44497) 2022-01-26 13:17:42 -08:00
idafurjes
58ee553634
Chore: Remove bus from user api (#44468)
* Chore: Remove bus from user api

* Adu authinfoservice interface

* User authinfoservice.Service instead of authinfoservice.Implementation in HTTPServer

* Rename Implementation to authInfoService
2022-01-26 20:24:05 +01:00
Ryan McKinley
5d66194ec5
FeatureFlags: define features outside settings.Cfg (take 3) (#44443) 2022-01-26 09:44:20 -08:00
Serge Zaitsev
84a5910e56
Chore: Remove bus from ngalert (#44465)
* pass notification service down to the notifiers

* add ns to all notifiers

* remove bus from ngalert notifiers

* use smaller interfaces for notificationservice

* attempt to fix the tests

* remove unused struct field

* simplify notification service mock

* trying to resolve issues in the tests

* make linter happy

* make linter even happier

* linter, you are annoying
2022-01-26 16:42:40 +01:00
Gabriel MABILLE
d4f682190f
AccessControl: Implement teams resource service (#43951)
* AccessControl: cover team permissions

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Add background service as a consumer to resource_services

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Define actions in roles.go

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Remove action from accesscontrol model

 Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* As suggested by kalle

* move some changes from branch to the skeleton PR

* Add background service as a consumer to resource_services

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* moving resourceservice to the main wire file pt2

* move team related actions so that they can be reused

* PR feedback

* fix

* typo

* Access Control: adding hooks for team member endpoints (#43991)

* AccessControl: cover team permissions

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Add background service as a consumer to resource_services

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Define actions in roles.go

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Remove action from accesscontrol model

 Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* As suggested by kalle

* add access control to list and add team member endpoint, and hooks for adding team members

* member permission type is 0

* add ID scope for team permission checks

* add more team actions, use Member for member permission name

* protect team member update endpoint with FGAC permissions

* update SQL functions for teams and the corresponding tests

* also protect team member removal endpoint with FGAC permissions and add a hook to permission service

* a few small fixes, provide team permission service to test setup

* AccessControl: cover team permissions

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Add background service as a consumer to resource_services

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Define actions in roles.go

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Remove action from accesscontrol model

 Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* As suggested by kalle

* move some changes from branch to the skeleton PR

* remove resource services from wireexts

* remove unneeded actions

* linting fix

* remove comments

* feedback fixes

* feedback

* simplifying

* remove team member within the same transaction

* fix a mistake with the error

* call the correct sql fction

* linting

* Access control: tests for team member endpoints (#44177)

* tests for team member endpoints

* clean up and fix the tests

* fixing tests take 2

* don't import enterprise test license

* don't import enterprise test license

* remove unused variable

Co-authored-by: gamab <gabi.mabs@gmail.com>
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>
2022-01-26 14:48:41 +00:00
Morten Nygaard Åsnes
9e4aafa719
MSSQL: Configuration of certificate verification for TLS connection (#31865)
Fixes #24589

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-01-26 15:00:18 +01:00
Marcus Efraimsson
50fabe8a87
Chore: Implements log15 terminal logger (#44447)
Nicer development/terminal output based on log15 terminal logger.
2022-01-26 12:19:43 +01:00
Mitsuhiro Tanda
d1083b9597
Cloud Monitoring: Reduce request size when listing labels (#44365) 2022-01-26 12:02:42 +01:00
Marcus Efraimsson
7593fc0a20
Provisioning: Fix duplicate validation when multiple organizations have been configured (#44151)
Fix duplicate validation when multiple organizations have been configured. 
This makes sure that all duplicate validation is being made for each organization.

Fixes #44126
2022-01-26 11:33:31 +01:00
Katarina Yang
92ca38bedf
Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in misc files (#43926)
* Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in misc files

* Refactor: Change .inTransaction in org.go file

* Refactor: Update init() to proper SQLStore handlers

* Refactor: Update funcs in tests to be sqlStore methods

* Refactor: Update API funcs to receive HTTPServer

* Fix: define methods on sqlstore

* Adjust GetSignedInUser calls

* Refactor: Add sqlStore to Service struct

* Chore: Add back black spaces to remove file from PR

Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
2022-01-25 20:30:08 +01:00
Karl Persson
de2c5783fa
Access Control: Pass db session to hooks (#44428)
* Move hook calls to database and pass session
2022-01-25 17:12:00 +01:00
Marcus Efraimsson
9ab9fd802b
OAuth: Fix parsing of ID token if header contains non-string value (#44159)
Fixes #41111
2022-01-25 17:09:35 +01:00
Will Browne
124bf413a2
make plugin loading for nested plugins more deterministic (#44330) 2022-01-25 16:05:12 +01:00
Marcus Efraimsson
62b69a0b90
Revert "Search: Fix only searching for folder id zero (#44175)" (#44424)
This reverts commit 007cd144a9 from #44175.
2022-01-25 15:04:26 +01:00
Sergey Kostrukov
cb09162cde
Datasources: Simplify the AzureCredentials structure in datasource config (#39209)
Related #35857

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-01-25 14:23:32 +01:00
Alex Khomenko
aead2e9157
Navigation: allow adding extra content (#44048)
* Add PRO badge

* Allow adding extra content

* Add extra content for the new navbar

* Use highlight text instead of extra content

* Trigger extra events

* Remove ExtraContent

* Update public/app/core/components/NavBar/NavFeatureHighlight.tsx

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>

* Remove redundant i

* Add UpgradeBox

* Move highlight to menu trigger

* Clear navbar next

* Cleanup

* Fix UpgradeBox styles

* Add arrow icon

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-01-25 10:04:44 +02:00
idafurjes
dbb2d3af73
Chore: Fix attribute value (#44368)
* Fix attribute value

* Fix also the value for opentracing
2022-01-24 18:17:39 +01:00
Igor Suleymanov
fdeaf7a5c4
Add nil checks to HTTP request validation dispatch (#44371)
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
2022-01-24 16:43:44 +01:00
Agnès Toulet
65bdb3a899
FeatureFlags: Revert managing feature flags outside of settings.Cfg (#44382)
* Revert "FeatureToggles: register all enterprise feature toggles (#44336)"

This reverts commit f53b3fb007.

* Revert "FeatureFlags: manage feature flags outside of settings.Cfg (#43692)"

This reverts commit f94c0decbd.
2022-01-24 16:08:05 +01:00
Guilherme Caulada
29268483c2
HTTPServer: Implement named middlewares (#44231)
* Implement named middlewares on http server

* Fix minor ordering issue with named middlewares
2022-01-24 10:41:18 -03:00
Gábor Farkas
9161f9d2e1
prometheus: added json-loading benchmark (#44309) 2022-01-24 14:39:26 +01:00
idafurjes
00c389933b
Chore: Remove bus from team (#44218)
* Remove bus from team

* Fix api team test

* Remove bus from team members
2022-01-24 11:52:35 +01:00
Gábor Farkas
0f8b0dc301
prometheus: refactor test (#44358) 2022-01-24 11:08:41 +01:00
Jeff Levin
c8154b9fe2
Datasource API: #32556 resolve readonly datasources can be modified (#44186)
* Check if datasource is read-only when making an update
* Standardize api returning a 404 if datasource is not found while making an update

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>, Jesse Weaver<pianohacker@gmail.com>
2022-01-21 14:22:43 -09:00
Ryan McKinley
f53b3fb007
FeatureToggles: register all enterprise feature toggles (#44336) 2022-01-21 20:36:28 +01:00
Marius Bezuidenhout
9fc0aee02b
Feature/mathandreduce (#41608)
* Added new math functions: round, ceil, floor 
* Added a new reduce function: last.
2022-01-21 13:15:50 -05:00
Yuriy Tseretyan
ce0ef0ef5e
create only one folder per dashboard with acl (#44283) 2022-01-21 10:24:41 -05:00
Jean-Philippe Quéméner
8ee3f59cd4
Alerting: recognize Cortex datasources correctly in the frontend (#44316)
* Alerting: always use msg field for user facing errors

* fix: revert front-end Cortex detection

Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
2022-01-21 15:44:11 +01:00
Marcus Efraimsson
007cd144a9
Search: Fix only searching for folder id zero (#44175)
Fixes so that searching for folder id zero in folder/dashboard search returns 
dashboards located in the general folder and not including all folders as it 
did before.

Fixes #40273
2022-01-21 13:51:58 +01:00
Will Browne
da98ebdcdf
Plugins: Remove old code related to Core plugin installs (#44311)
* remove old code

* remove even more

* skip flaky test
2022-01-21 13:38:04 +01:00
Will Browne
3cb0fb3ddc
fix and add test (#44286) 2022-01-21 11:00:20 +01:00
Ryan McKinley
f94c0decbd
FeatureFlags: manage feature flags outside of settings.Cfg (#43692) 2022-01-20 13:42:05 -08:00
Will Browne
7fbc7d019a
Plugins: Core plugins register via backend factory provider (#43171)
* refactoring store interface and init flow

* fix import

* fix linter

* refactor resource calling

* load with class

* re-order args

* fix tests

* fix linter

* remove old creator

* add custom config struct

* fix some tests

* cleanup

* fix

* tackle plugins

* fix linter

* refactor and fix test

* add connect failure error

* add fix for azure, cloud monitoring and test data

* restructure

* remove unused err

* add fake tracer for test

* fix grafana ds plugin
2022-01-20 18:16:22 +01:00
Eric Leijonmarck
9ccc7ec76e
Serviceaccounts: convert selection of apikeys to serviceaccounts (#44154)
* convert selected of apikeys to serviceaccounts

* update to use one by one

* expose endpoint of service account
2022-01-20 16:51:18 +01:00
Isabella Siu
2c3bed1f4b
CloudWatch: remove unused "live" log code (#44185) 2022-01-20 08:58:39 -05:00
idafurjes
30aa24a183
Chore: Implement OpenTelemtry in Grafana (#42674)
* Separate Tracer interface to TracerService and Tracer

* Fix lint

* Fix:Make it possible to start spans for both opentracing and opentelemetry in ds proxy

* Add span methods, use span interface for rest of tracing

* Fix logs in tracing

* Fix tests that are related to tracing

* Fix resourcepermissions test

* Fix some tests

* Fix more tests

* Add TracingService to wire cli runner

* Remove GlobalTracer from bus

* Renaming test function

* Remove GlobalTracer from TSDB

* Replace GlobalTracer in api

* Adjust tests to the InitializeForTests func

* Remove GlobalTracer from services

* Remove GlobalTracer

* Remove bus.NewTest

* Remove Tracer interface

* Add InitializeForBus

* Simplify tests

* Clean up tests

* Rename TracerService to Tracer

* Update pkg/middleware/request_tracing.go

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Initialize tracer before passing it to SQLStore initialization in commands

* Remove tests for opentracing

* Set span attributes correctly, remove unnecessary trace initiliazation form test

* Add tracer instance to newSQLStore

* Fix changes due to rebase

* Add modified tracing middleware test

* Fix opentracing implementation tags

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-01-20 11:10:12 +01:00
Katarina Yang
61974383d7
Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in alert files (#43815)
* Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in alert files

* Fix: Revert second SaveAlerts back to normal func

* Refactor: Update tests so functions are now SQLStore methods

* Fix: Refactor pauseAlert and pauseAllAlerts to be SQLStore methods

* Fix: Refactor SaveAlerts to be SQLStore method

* Refactor: Update SaveAlerts func signature to have correct arguments

* Refactor: Define sqlStore

* Chore: Delete commented out code

* Chore: Remove unused SaveAlertsCommand
2022-01-19 19:25:52 +00:00
Eric Leijonmarck
bf4c217b95
Serviceaccounts: refactor list using server admin page (#44122)
* refactor: use server admin listing serviceaccounts

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

* setup route for specifc service account

* add routes to index

* main issue with spelling mistakes

* feat: make routes /serviceacconts/id for navModel

Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>

* Update pkg/services/serviceaccounts/manager/service.go

Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
2022-01-19 17:03:45 +01:00
J Guerreiro
7dab52869e
ServiceAccounts: Add detail view of service account (#44164)
* ServiceAccounts: Add detail view of service account

Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>

* ServiceAccount: Make detail view scopeID

Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>

* ServiceAccount: fix lint error

Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>

Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>
2022-01-19 10:23:46 +01:00
Dessen Xu
8917e66eb4
Fix kiosk bug (#43152)
* fix_kiosk_bug

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
2022-01-19 10:58:22 +02:00
Jeremy Price
6ae7b0c3b2
Accesscontrol: list tokens for service account (#43809)
* Add list tokens endpoint

* Update api.go

Co-authored-by: J Guerreiro <joao.guerreiro@grafana.com>
2022-01-19 09:55:38 +01:00
Gabriel MABILLE
54280fc9d7
AccessControl: Resolve attribute based scopes to id based scopes (#40742)
* AccessControl: POC scope attribute resolution

Refactor based on ScopeMutators

test errors and calls to cache

Add comments to tests

Rename logger

Create keywordMutator only once

* AccessControl: Add AttributeScopeResolver registration

Co-authored-by: gamab <gabriel.mabille@grafana.com>

* AccessControl: Add AttributeScopeResolver to datasources

Co-authored-by: gamab <gabriel.mabille@grafana.com>

* Test evaluation with translation

* fix imports

* AccessControl: Test attribute resolver

* Fix trailing white space

* Make ScopeResolver public for enterprise redefine

* Handle wildcard

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

Co-authored-by: jguer <joao.guerreiro@grafana.com>
2022-01-18 17:34:35 +01:00
Dimitris Sotirakis
c1ba0afdc7
GetUserInfo: Return an error if no user was found (#44169)
* return an error if no user was found

* Update database.go

Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
2022-01-18 17:03:16 +01:00
Andres Martinez Gotor
4e1c7e868e
Cloudwatch: use the backend HTTP client provider (#44036) 2022-01-18 09:34:12 +01:00
Piotr Jamróz
9fb8339f87
Elastic: Allow using long/int as date field for alerts (#44027)
* Use integers for time range filter

Previously it was passed as a string which is automatically converted by Elastic to a number only if the field type is "date". For other types (e.g. "long") such conversion doesn't work. In theory "date" could be passed as a formatted string but we don't use it this way and always pass it as a number so it is safe to always pass numbers, not strings.

* Fix time_series_query_test

* Retrigger build
2022-01-17 15:45:09 +01:00
Ivana Huckova
e704110f74
Prometheus: Fix interpolation of $__rate_interval variable (#44035)
* Name fields based on targets length

* Remove rounding in rate interval variable replacing

* Refactor and fix edge  case when interval and time duration would be rate interval

* Add tests

* Remove , from test

* Revert "Name fields based on targets length"

This reverts commit 5dcb34a765.
2022-01-17 15:32:23 +01:00
Will Browne
a65ce992c1
fix delete plugin dashboard (#44055) 2022-01-17 10:33:42 +01:00
Karl Persson
f75e4d1a4f
Access Control: Allow signed in users access to GET data sources endpoints (#43338)
* remove scopes from endpoints and add datasources:read without scope to
the compatibility role
2022-01-17 10:16:12 +01:00
ying-jeanne
7422789ec7
Remove Macaron ParamsInt64 function from code base (#43810)
* draft commit

* change all calls

* Compilation errors
2022-01-15 00:55:57 +08:00
Will Browne
7694fff0ef
[WIP] Plugins: Refactoring backend initialization flow (#42247)
* refactoring store interface and init flow

* fix import

* fix linter

* refactor resource calling

* load with class

* re-order args

* fix tests

* fix linter

* remove old creator

* add custom config struct

* fix some tests

* cleanup

* fix linter

* add connect failure error

* remove unused err

* convert test over
2022-01-14 13:30:39 +01:00
J Guerreiro
1e9818a69f
Add usage stats preview endpoint (#43899)
* Stats: add preview route for usage statistics

* Stats: respect reporting settings

* Stats: add tests to api endpoint

* Stats: unregister route

* Stats: always possible to preview stats

* Update pkg/infra/usagestats/service/api.go

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2022-01-14 10:16:07 +01:00
Gábor Farkas
bedc5cccaa
prometheus: fix auto-inserting null-timestamps at the end (#44022) 2022-01-14 09:25:15 +01:00
Alexander Weaver
c68eefd398
Alerting: Add abstraction layer and testing hooks in front of SMTP dialer (#43875)
* Add abstraction layer above SMTP communication

* Fix issues with attachments and sync command

* Tests for bad SMTP behavior

* Separate tests between async and sync entry points. Test difference between them

* Return interface so Wire can properly map types

* Address feedback from George
2022-01-13 15:19:15 -06:00
Yuriy Tseretyan
8114f6b065
Use stack trace context in XORM trace logger (#43780)
* add caller and stack Valuer functions
* Add WithPrefix and WithSuffix similar to what go-kit offers
* replace New with just `with`. Remove filter wrapper because the first argument of the context argument is not logger but additional context.
* update Xorm logger to use custom depth to display the datastore code instead of xorm
2022-01-13 13:30:28 -05:00
Emil Tullstedt
25736b6afb
Auth: implement auto_sign_up for auth.jwt (#43502)
Co-authored-by: James Brown <jbrown@easypost.com>
2022-01-13 17:15:22 +01:00
Karl Persson
f999910dc6
Access control: Add access control sql filter to org user queries (#43961)
* Add access control SQL filter to org user queries
2022-01-13 14:40:32 +01:00
Eric Leijonmarck
ccd9e46dda
changed route on the serviceaccounts endpoint (#43989)
* changed route on the serviceaccounts endpoint

* refactor: change to base url variable

* tests fixed
2022-01-13 14:15:43 +01:00
Gábor Farkas
4a88b8f66c
Prometheus: add tests covering the prometheus-response to dataframes conversion (#43892)
* prometheus: add tests covering prometheus_response to grafana_dataframes

* fixed variable name

* added comment

* removed not-helping function call
2022-01-13 11:52:50 +01:00
Victor Marin
f881fd1637
Postgres/MySQL/MSSQL: Cancel in-flight SQL query if user cancels query in grafana (#43890) 2022-01-12 16:24:27 +02:00
Jeremy Price
e894837b7e
Accesscontrol: Remove service account creation code from addapikey (#43900)
* Remove service account creation code from addapikey
Co-authored-by: J Guerreiro <joao.guerreiro@grafana.com>
2022-01-12 15:18:57 +01:00
Eric Leijonmarck
6409e761b5
List serviceaccounts (#43672)
* Serviceaccounts: feat - tabview for serviceaccounts

* WIP

* feat: listing all service accounts

* refactor: needed to remove showInvitees as not present in serviceaccounts

* add token column in the list

* add token to orgserviceaccount

* Update pkg/services/serviceaccounts/api/api.go
2022-01-12 13:23:00 +01:00
Ashley Harrison
1966eba796
Chore: Add some e2e tests for repeating behaviour (#43457)
* user essentials mob! 🔱

* user essentials mob! 🔱

* WIP: Mob session work 🚧 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* mob next [ci-skip] [ci skip] [skip ci]

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* 🚧: Mob session work 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* Move repeats suite under dashboard suite

* remove these generated files

* move repeats-suite into dashboards-suite

* Reexport dashboard jsons from play and update them

* 🚧: Mob session work 🔱

* 🚧: Mob session work 🔱

* Rename dashboards to work with stripnulls

* Run stripnulls

* Add repeat to row schema

* Clean up the rest of the repeating dashboards

* Fix tooltip sorting

* Update older dashboards

* Update golden files so tests pass

* format this to ensure consistent tabs/spaces

* undo whitespace changes

* Update scripts/stripnulls.sh

Co-authored-by: sam boyer <sam.boyer@grafana.com>

* update schema versions and test

Co-authored-by: thisisobate <obasiuche62@gmail.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
Co-authored-by: joshhunt <josh@trtr.co>
Co-authored-by: kay delaney <kay@grafana.com>
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
Co-authored-by: sam boyer <sam.boyer@grafana.com>
2022-01-11 16:47:30 +00:00
Sofia Papagiannaki
963ae4ef87
API: Fix storing dashboard with static UID (#43861)
* API: Fix storing dashboard with static UID
2022-01-11 18:39:53 +02:00
Yuriy Tseretyan
ed5c664e4a
Alerting: Stop firing of alert when it is updated (#39975)
* Update API to call the scheduler to remove\update an alert rule. When a rule is updated by a user, the scheduler will remove the currently firing alert instances and clean up the state cache. 
* Update evaluation loop in the scheduler to support one more channel that is used to communicate updates to it.
* Improved rule deletion from the internal registry. 
* Move alert rule version from the internal registry (structure alertRuleInfo) closer rule evaluation loop (to evaluation task structure), which will make the registry values immutable.
* Extract notification code to a separate function to reuse in update flow.
2022-01-11 11:39:34 -05:00
Marcus Efraimsson
f6414ea2b2
CodeQL: Try to fix uncontrolled data used in path expression (#43462)
Ref #43080
2022-01-11 17:37:58 +01:00
Ieva
a06564fb0d
Access control: allow granting a fixed role dynamically based on the startup settings (#43867)
* allow granting a fixed role dynamically depending on startup config

* move role definition for team writing

* undo test changes

* nicer naming
2022-01-11 11:58:40 +01:00
Ieva
41b709d08d
Access control: permissions for team creation (#43506)
* FGAC for team creation

* tests

* fix snapshot for UI tests

* linting

* update snapshots

* Remove unecessary class and update tests

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Make the condition slightly easier

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

Co-authored-by: gamab <gabi.mabs@gmail.com>
2022-01-10 17:05:53 +00:00
Katarina Yang
5bab02c7ef
Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactional… (#43823)
* Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in user files

* update milesone
2022-01-10 11:28:41 -05:00
Ryan McKinley
b404aae9c3
Crawler: use existing render service to generate dashboard thumbnails (#43515)
Co-authored-by: Artur Wierzbicki <artur@arturwierzbicki.com>
2022-01-10 08:21:35 -08:00
Karl Persson
d350ed0f35
Access Control: SQL filter (#43560)
* Add the accesscontrol sql filter utility

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2022-01-10 14:26:57 +01:00
Karl Persson
0003bf7cc2
AzureAD OAuth: Add support for fetching user groups (#43470)
* Add functionallity to extractGroups to handle groups-overage claims
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2022-01-10 11:50:10 +01:00
Dominik Prokop
1a0f5595c3
TimeSeries/BarChart: Add support for sorting series in the tooltip (#43615)
* TimeSeries panel: Add support for sorting series in the tooltip

* Fix cue tests

* Make sortValues work with string values

* Sort values in DatHoverView and remove sort index from TooltipPlugin

* Rename sortOrder prop to sort

* DataHoverView - use raw values for sorting
2022-01-10 10:32:21 +01:00
Dan Cech
34f757ba5a
switch to using featureEnabled for enterprise features (#41559)
* switch to using featureEnabled for enterprise features
2022-01-07 15:11:23 -05:00
Travis Patterson
9eb82f9fff
Propagate all headers (#43812)
* Propagate all headers

* stable header order
2022-01-07 12:45:26 -07:00
Ryan McKinley
546818819b
Loki: use queryType rather than range|instant flags (#43727) 2022-01-07 10:00:11 -08:00
Katarina Yang
a30ca86084
Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactional… (#43772)
* Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in dashboard

* Fix: Fix failing lint and BE tests
2022-01-07 17:50:59 +01:00
Joan López de la Franca Beltran
532e71554f
Usage Stats: Add metrics to count enabled kms providers per kind (#43640)
* Usage Insights: Add metrics to count enabled kms providers per kind

* Add backwards compatibility
2022-01-07 13:52:28 +01:00
Selene
32ed680fc2
Team Guardian: Refactor it to remove the bus dependency (#43058)
* Refactor team guardian to avoid to use bus

* Fix lint

* Fix lint
2022-01-07 13:38:00 +01:00
Emil Tullstedt
fdd196a627
Datemath: Remove unused functions (#43665) 2022-01-07 12:53:31 +01:00
Yuriy Tseretyan
ea478dec22
Alerting: Remove bridge between log15 and go-kit logger (#43769)
* remove bridge between log15 and go-kit logger.

* fix tests
2022-01-07 09:40:09 +01:00
Katarina Yang
7f8daa0eae
Refactor: Change sqlstore.inTransaction to .WithTransactionalDBSession (#43245)
* Refactor: Change sqlstore.inTransaction(...) to SQLStore.WithTransactionalDBSession(...) in alert_notification.go

* Chore: Fix BE lint err

* fix: fix failing sqlstore nil error

* chore: remove unecessary setup()

* fix: use appropriate ctx
2022-01-06 18:21:39 +01:00
ying-jeanne
a8eef45a44
Logger migration from log15 to gokit/log (#41636)
* migrate log15 to gokit/log

* fix console log

* update some unittest

* fix all unittest

* fix the build

* Update pkg/infra/log/log.go

Co-authored-by: Yuriy Tseretyan <tceretian@gmail.com>

* general type vector

* correct the level key

Co-authored-by: Yuriy Tseretyan <tceretian@gmail.com>
2022-01-06 22:28:05 +08:00
J Guerreiro
6bbf85e2e9
AccessControl: verify metadata map is not null (#43743) 2022-01-06 11:54:51 +01:00
Travis Patterson
20b3b2a448
Forward oauth tokens after prometheus datasource migration (#43686)
* create the prom client

* implement lru cache of prometheus clients based on auth headers

* linter
2022-01-05 13:55:55 -07:00
Gabriel MABILLE
92c568e9f7
AccessControl: Remove unused error from GetResourcesMetadata (#43710)
* AccessControl: Remove unused error from GetResourcesMetadata

Co-authored-by: J Guerreiro <joao.guerreiro@grafana.com>
2022-01-05 17:24:14 +01:00
Alexander Weaver
fd583a0e3b
Alerting: Allow customization of Google chat message (#43568)
* Allow customizable googlechat message via optional setting

* Add optional message field in googlechat contact point configurator

* Fix strange error message on send if template fails to fully evaluate

* Elevate template evaluation failure logs to Warn level

* Extract default.title template embed from all channels to shared constant
2022-01-05 09:47:08 -06:00
Eric Leijonmarck
0aa905bb1f
Serviceaccounts: feat - tabview for serviceaccounts (#43573) 2022-01-05 15:32:38 +01:00
Ivana Huckova
d7d6c10664
Prometheus: Fill missing steps with null values (#43622)
* Prometheus: Add empty points when data points missing

* Remove newline

* Add comments

* Improve/Fix test

* Remove unused variable
2022-01-05 11:40:32 +01:00
Gilles De Mey
837925390f
fix: pass OrgId to alertNotification model (#43678)
fixes #43214
2022-01-05 10:19:45 +01:00
J Guerreiro
056e143664
AccessControl: Present user edit actions according to AC metadata (#43602)
* AccessControl: Add user metadata to user detail view

* AccessControl: Do not present delete or disable buttons based on ac metadata in admin/users

* AccessControl: do not allow password changing or user editing without permission

* AccessControl: Fetch global:users scope for admin

* AccessControl: optimize org.user metadata fetch

* Chore: early return if ac metadata is not available
2022-01-05 09:59:17 +01:00
Ryan McKinley
b09d498484
Import: fix dashboard imports with expressions (#43630) 2022-01-04 08:42:18 -08:00
Jeremy Price
42ccc44eca
Accesscontrol: Apply FGAC to APIKey endpoints (#42659)
* Move definitions to serviceaccounts

* Use constant names, add scope to delete

* Add descriptions to roles

* Rename roles
2022-01-04 15:37:40 +01:00