grafana/pkg/services/sqlstore
Dimitris Sotirakis 605d056136
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>
2022-02-09 13:44:38 +01:00
..
migrations Dash previews: populate crawler queue from SQL query (#44083) 2022-02-09 13:23:32 +04:00
migrator Alerting: Make Unified Alerting enabled by default for those who do not use legacy alerting (#42200) 2021-11-24 14:56:07 -05:00
mockstore ldap debug bus removal (#45014) 2022-02-09 11:45:31 +01:00
permissions Remove unnecesary joins from queries (#43626) 2022-01-04 13:04:02 +01:00
searchstore Revert "Search: Fix only searching for folder id zero (#44175)" (#44424) 2022-01-25 15:04:26 +01:00
sqlutil Chore: Add CloudWatch HTTP API tests (#29691) 2021-01-07 11:36:13 +01:00
alert_notification_test.go Refactor: Change sqlstore.inTransaction to .WithTransactionalDBSession (#43245) 2022-01-06 18:21:39 +01:00
alert_notification.go Chore: Remove bus from the alerting service (#44496) 2022-02-03 13:26:05 +01:00
alert_test.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in misc files (#43926) 2022-01-25 20:30:08 +01:00
alert.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in alert files (#43815) 2022-01-19 19:25:52 +00:00
annotation_cleanup_test.go Instrumentation: Start tracing database requests (#34572) 2021-05-27 13:55:33 +02:00
annotation_cleanup.go Annotations: Prevent orphaned annotation tags cleanup when no annotations were cleaned (#33957) 2021-05-12 10:44:00 +02:00
annotation_test.go fix for CWE-89 (#43407) 2021-12-21 19:04:56 +01:00
annotation.go fix for CWE-89 (#43407) 2021-12-21 19:04:56 +01:00
apikey_test.go Add/Delete API keys to Service accounts (#44871) 2022-02-07 14:51:54 +01:00
apikey.go Add/Delete API keys to Service accounts (#44871) 2022-02-07 14:51:54 +01:00
dashboard_acl_test.go Chore: Remove context.TODO() (#43409) 2021-12-22 11:02:42 +01:00
dashboard_acl.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
dashboard_folder_test.go Chore: Remove bus from index (#44851) 2022-02-03 18:22:21 +01:00
dashboard_provisioning_test.go Chore: Remove bus from signup and playlist api (#44485) 2022-01-27 10:33:02 +01:00
dashboard_provisioning.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in misc files (#43926) 2022-01-25 20:30:08 +01:00
dashboard_snapshot_test.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactional… (#43772) 2022-01-07 17:50:59 +01:00
dashboard_snapshot.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactional… (#43772) 2022-01-07 17:50:59 +01:00
dashboard_test.go Remove bus from dashboard api (#44923) 2022-02-07 12:43:43 +01:00
dashboard_thumbs_test.go Dash previews: populate crawler queue from SQL query (#44083) 2022-02-09 13:23:32 +04:00
dashboard_thumbs.go Dash previews: populate crawler queue from SQL query (#44083) 2022-02-09 13:23:32 +04:00
dashboard_version_test.go Remove unused GetDashboard method (#44890) 2022-02-04 17:21:06 +01:00
dashboard_version.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
dashboard.go Remove bus from dashboard api (#44923) 2022-02-07 12:43:43 +01:00
database_wrapper.go Chore: Implement OpenTelemtry in Grafana (#42674) 2022-01-20 11:10:12 +01:00
datasource_test.go Rename AddEventListenerCtx to AddEventListener and PublishCtx to Publish (#43566) 2022-01-04 09:36:01 +01:00
datasource.go Chore: Add context to datasource service (#42294) 2021-11-26 18:10:36 +01:00
health_test.go Chore: Remove bus from health api (#44897) 2022-02-04 14:33:35 +01:00
health.go Chore: Remove bus from health api (#44897) 2022-02-04 14:33:35 +01:00
logger.go Chore: Update the xorm dependency (#22376) 2020-04-01 15:57:21 +02:00
login_attempt_test.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in misc files (#43926) 2022-01-25 20:30:08 +01:00
login_attempt.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in misc files (#43926) 2022-01-25 20:30:08 +01:00
org_test.go ldap debug bus removal (#45014) 2022-02-09 11:45:31 +01:00
org_users_test.go FeatureFlags: define features outside settings.Cfg (take 3) (#44443) 2022-01-26 09:44:20 -08:00
org_users.go AccessControl: Use an SQLFilter struct (#44887) 2022-02-07 16:18:52 +01:00
org.go ldap debug bus removal (#45014) 2022-02-09 11:45:31 +01:00
playlist_test.go Chore: Add context to playlist (#41337) 2021-11-19 14:32:14 +01:00
playlist.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
plugin_setting.go Chore: Propagate context for plugin settings (#41166) 2021-11-02 13:42:55 +01:00
preferences_test.go Admin: Fix so Timezone is saved when saving preferences (#41583) 2021-11-11 11:13:01 +01:00
preferences.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
quota_test.go Chore: Add context to org (#40685) 2021-11-03 11:31:56 +01:00
quota.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
session.go Reuse opened session in the context (#44939) 2022-02-08 09:02:23 -05:00
sqlbuilder_test.go Chore: Remove context.TODO() (#43409) 2021-12-22 11:02:42 +01:00
sqlbuilder.go Remove unnecesary joins from queries (#43626) 2022-01-04 13:04:02 +01:00
sqlstore_test.go Chore: update all +build statements (#38782) 2021-09-01 17:38:56 +03:00
sqlstore.go Dash previews: populate crawler queue from SQL query (#44083) 2022-02-09 13:23:32 +04:00
sqlstore.goconvey feat(invite): small progress 2015-07-17 14:42:49 +02:00
star.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
stars_test.go Chore: Add context to star and stats (#39591) 2021-09-28 17:54:45 +02:00
stats_integration_test.go Chore: Remove bus from admin (#44920) 2022-02-04 17:53:58 +01:00
stats_test.go Chore: Remove bus from admin (#44920) 2022-02-04 17:53:58 +01:00
stats.go Chore: Remove bus from admin (#44920) 2022-02-04 17:53:58 +01:00
store.go ldap debug bus removal (#45014) 2022-02-09 11:45:31 +01:00
tables.go Began work on real sql schema definitions, and migration engine 2015-01-17 21:40:22 +01:00
tags_test.go Chore: Remove GoConvey from sqlstore package (#40753) 2021-10-21 14:09:19 +02:00
tags.go Chore: Enable Go linter gocritic (#26224) 2020-07-16 14:39:01 +02:00
team_test.go AccessControl: Implement teams resource service (#43951) 2022-01-26 14:48:41 +00:00
team.go Security: Sync security changes on main (#45083) 2022-02-09 13:44:38 +01:00
temp_user_test.go Chore: Add context to temp user (#41284) 2021-11-04 11:17:07 +01:00
temp_user.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
tls_mysql.go Chore: Fix staticcheck issues (#28854) 2020-11-05 11:57:20 +01:00
transactions_test.go Reuse opened session in the context (#44939) 2022-02-08 09:02:23 -05:00
transactions.go Reuse opened session in the context (#44939) 2022-02-08 09:02:23 -05:00
user_test.go Chore: Remove bus from user api (#44468) 2022-01-26 20:24:05 +01:00
user.go Remove bus from quota, preferences, plugins, user_token (#44762) 2022-02-03 09:20:20 +01:00