* Update silence url generation
* Update tests
* Update test to the new silence params format
* Fix tests
(cherry picked from commit aeec087065)
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
* CloudWatch: Add test to executeStartQuery
* Add test for absence of limit
* Restrict assertions to limit in some tests
(cherry picked from commit a68a570e92)
Co-authored-by: Shirley <4163034+fridgepoet@users.noreply.github.com>
This commit changes staleResultsHandler to create an annotation if the current state is Alerting and the result is being removed from the state cache as it has not been updated since 2x the evaluation interval.
(cherry picked from commit feae959c9d)
* add field for custom slack endpoint
* add test for using custom endpoint
* Update pkg/services/ngalert/notifier/channels/slack.go
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
* specify description for endpoint
* remove brittle string constants
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
(cherry picked from commit f9701d78b1)
Co-authored-by: Nathan Rodman <nathanrodman@gmail.com>
* CLI: Adjust 're-encrypt-data-keys' command
* CLI: Adjust 're-encrypt' command
* Multiple improvements on re-encrypt secrets migration
* Another bunch of code improvements
* Lint fixes
(cherry picked from commit e6a85826e9)
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
* Chore: add setting to skip org assignment for external users
Introduce 'skip_org_role_update_sync' setting to skip any kind of org assignment during the login of external users.
As a consequence manual organization assignments won't be overridden during the upsert of an external user.
Part of #22605
* Chore: Rename skip_org_role_update_sync to oauth_skip_org_role_update_sync and relocate it to auth section
* Chore: replace global setting access where possible
(cherry picked from commit 6beba5a049)
Co-authored-by: baez90 <peter.kurfer@googlemail.com>
* set missing meta data for distribution type metrics
* add test
* add test
* simplify custom set
* add test for executedQueryString
* add test data
* fix tests
* check group by
(cherry picked from commit 0fb490c00d)
Co-authored-by: Mitsuhiro Tanda <mitsuhiro.tanda@gmail.com>
* make send_alerts_to field nullable
* set nullable to true since we have a default value
(cherry picked from commit a9de33601c)
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
The problem here is that without the orgID we ignore the lookup of the existing notification channel just before updating and end up failing the update because there is no channel available.
(cherry picked from commit 8bf2e642aa)
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* show teams page for user who can't list teams but can create teams
* Fixing buttons and routes
* Small refactor
Co-authored-by: gamab <gabi.mabs@gmail.com>
(cherry picked from commit 6fb3aac2e1)
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
* AccessControl: Filter team members
* Modify GetTeamMembersByUser comment
* Fix postgres failing test due to quoting
* Rename GetTeamMembersByUser to GetUserTeamMemberships
* Update TeamStore interface
(cherry picked from commit 78fc0258b1)
Fixes a problem where server hangs if setting
GF_DATABASE_LOG_QUERIES=true.
Ref #44925
(cherry picked from commit ca311bf94f)
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Fixes log filters that contains comments should not be enabled
(cherry picked from commit 2082eeb72f)
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* Revert fixed roles and service accounts
* Leave the fixed role for service accounts
(cherry picked from commit f38f10416a)
Co-authored-by: Vardan Torosyan <vardants@gmail.com>
* Security: Sync security changes on main (#45083)
* * Teams: Appropriately apply user id filter in /api/teams/:id and /api/teams/search
* Teams: Ensure that users searching for teams are only able see teams they have access to
* Teams: Require teamGuardian admin privileges to list team members
* Teams: Prevent org viewers from administering teams
* Teams: Add org_id condition to team count query
* Teams: clarify permission requirements in teams api docs
* Teams: expand scenarios for team search tests
* Teams: mock teamGuardian in tests
Co-authored-by: Dan Cech <dcech@grafana.com>
* remove duplicate WHERE statement
* Fix for CVE-2022-21702
(cherry picked from commit 202d7c190082c094bc1dc13f7fe9464746c37f9e)
* Lint and test fixes
(cherry picked from commit 3e6b67d5504abf4a1d7b8d621f04d062c048e981)
* check content type properly
(cherry picked from commit 70b4458892bf2f776302720c10d24c9ff34edd98)
* basic csrf origin check
(cherry picked from commit 3adaa5ff39832364f6390881fb5b42ad47df92e1)
* compare origin to host
(cherry picked from commit 5443892699e8ed42836bb2b9a44744ff3e970f42)
* simplify url parsing
(cherry picked from commit b2ffbc9513fed75468628370a48b929d30af2b1d)
* check csrf for GET requests, only compare origin
(cherry picked from commit 8b81dc12d8f8a1f07852809c5b4d44f0f0b1d709)
* parse content type properly
(cherry picked from commit 16f76f4902e6f2188bea9606c68b551af186bdc0)
* mentioned get in the comment
(cherry picked from commit a7e61811ef8ae558ce721e2e3fed04ce7a5a5345)
* add content-type: application/json to test HTTP requests
* fix pluginproxy test
* Fix linter when comparing errors
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
Co-authored-by: Dan Cech <dcech@grafana.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
Co-authored-by: Vardan Torosyan <vardants@gmail.com>
(cherry picked from commit 605d056136)
* Apply suggestions from code review
* remove uneeded test fix from patch
Co-authored-by: Dimitris Sotirakis <sotirakis.dim@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: jguer <joao.guerreiro@grafana.com>
* hide team role column
* hide or disable the role picker as needed
* add SWL filtering for role listing
(cherry picked from commit 4f4b1cb5ea)
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>