grafana/pkg/services/sqlstore
Guilherme Caulada 2d8a91a846
Secrets: Improve unified secrets migration and implement compatibility flag (#50463)
* Implement disableSecretsCompatibility flag

* Allow secret deletion right after migration

* Use dialect.Quote for secure_json_data on secret deletion

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Set secure_json_data to NULL instead of empty json

* Run toggles_gen_test and use generated flag variable

* Add ID to delete data source secrets command on function call

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Remove extra query to get datasource on secret deletion

* Fix linting issues with CHANGELOG.md

* Use empty json string when deleting secure json data

* Implement secret migration as a background process

* Refactor secret migration as a background service

* Refactor migration to be inside secret store

* Re-add secret deletion function removed on merge

* Try using transaction to fix db lock during tests

* Disable migration for pipeline debugging

* Try adding sleep to fix database lock

* Remove unecessary time sleep from migration

* Fix merge issue, replace models with datasources

* Try event listener approach

* Fix merge issue, replace models with datasources

* Fix linting issues with unchecked error

* Remove unecessary trainling new line

* Increase wait interval on background secret migration

* Rename secret store migration folder for consistency

* Convert background migration to blocking

* Fix number of arguments on server tests

* Check error value of secret migration provider

* Fix linting issue with method varaible

* Revert unintended change on background services

* Move secret migration service provider to wire.go

* Remove unecessary else from datasource service

* Move transaction inside loop on secret migration

* Remove unecessary GetServices function

* Remove unecessary interface after method removal

* Rename Run to Migrate on secret migration interface

* Rename secret migrations service variable on server

* Use MustBool on datasource secret migration

* Revert changes to GetDataSources

* Implement GetAllDataSources function

* Remove DeleteDataSourceSecrets function

* Move datasource secret migration to datasource service

* Remove unecessary properties from datasource secret migration

* Make DecryptLegacySecrets a private method

* Remove context canceled check on secret migrator

* Log error when fail to unmarshal datasource secret

* Add necessary fields to update command on migration

* Handle high availability on secret migration

* Use kvstore for datasource secret migration status

* Add error check for migration status set on kvstore

* Remove NewSecretMigrationService from server tests

* Use const for strings on datasource secrets migration

* Test all cases for datasources secret migrations

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-07-12 17:27:37 -03:00
..
db Dashboards: Split GetDashboardVersions method (#49967) 2022-06-02 15:59:05 +02:00
migrations Alerting: Update default route groupBy to [grafana_folder, alertname] (#50052) 2022-07-11 12:24:43 -04:00
migrator Chore: Remove Wrapf (#50128) 2022-06-06 22:30:31 +02:00
mockstore Access Control: Allow dashboard admins to query org users (#51652) 2022-07-04 10:43:06 +01:00
permissions Access Control: Move dashboard actions and create scope provider (#48618) 2022-05-04 16:12:09 +02:00
searchstore Search (SQL): support dashboardUID query parameter (#50121) 2022-06-02 12:56:01 -07:00
sqlutil Chore: Add CloudWatch HTTP API tests (#29691) 2021-01-07 11:36:13 +01:00
alert_notification_test.go Chore: Exclude integration tests from running on test-backend step (#50359) 2022-06-10 11:46:21 -04:00
alert_notification.go Chore: Remove final x from sqlstore (#48086) 2022-04-25 13:07:11 -04:00
alert_test.go Chore: Exclude integration tests from running on test-backend step (#50359) 2022-06-10 11:46:21 -04:00
alert.go Chore: Remove bus (#47511) 2022-04-08 16:15:06 +02:00
annotation_cleanup_test.go Chore: Remove final x from sqlstore (#48086) 2022-04-25 13:07:11 -04:00
annotation_cleanup.go Chore: Remove final x from sqlstore (#48086) 2022-04-25 13:07:11 -04:00
annotation_test.go Chore: Exclude integration tests from running on test-backend step (#50359) 2022-06-10 11:46:21 -04:00
annotation.go Access control: further reduce access control feature toggle checks (#48171) 2022-05-05 17:31:14 +02:00
apikey_test.go ServiceAccounts: Add Service Account Token last used at date (#51446) 2022-06-28 16:42:40 +02:00
apikey.go ServiceAccounts: Add Service Account Token last used at date (#51446) 2022-06-28 16:42:40 +02:00
dashboard_thumbs_test.go chore/backend: move dashboard errors to dashboard service (#51593) 2022-06-30 09:31:54 -04:00
dashboard_thumbs.go chore/backend: move dashboard errors to dashboard service (#51593) 2022-06-30 09:31:54 -04:00
database_wrapper.go Tracing: Use common traceID context value for opentracing and opentelemetry (#46411) 2022-04-14 17:54:49 +02:00
datasource_test.go backend/datasources: move datasources models into the datasources service package (#51267) 2022-06-27 12:23:15 -04:00
datasource.go Secrets: Improve unified secrets migration and implement compatibility flag (#50463) 2022-07-12 17:27:37 -03:00
health_test.go Chore: Exclude integration tests from running on test-backend step (#50359) 2022-06-10 11:46:21 -04:00
health.go Chore: Remove x from health, alert notification, dashboard, stats, user (#45265) 2022-02-17 16:59:09 +01:00
logger.go Chore: Update the xorm dependency (#22376) 2020-04-01 15:57:21 +02:00
login_attempt_test.go Chore: Exclude integration tests from running on test-backend step (#50359) 2022-06-10 11:46:21 -04:00
login_attempt.go Chore: Remove bus (#47511) 2022-04-08 16:15:06 +02:00
org_test.go chore/backend: move dashboard errors to dashboard service (#51593) 2022-06-30 09:31:54 -04:00
org_users_test.go ServiceAccounts: Don't create new orgs for service accounts (#51819) 2022-07-07 08:50:38 -04:00
org_users.go ServiceAccounts: Don't create new orgs for service accounts (#51819) 2022-07-07 08:50:38 -04:00
org.go Chore: Remove global bus variable (#50765) 2022-06-14 16:07:41 +02:00
playlist_test.go backend: add PlaylistUIDs to Playlist; remove playlist IDs from API (#49609) 2022-06-14 15:32:52 -04:00
playlist.go backend: add PlaylistUIDs to Playlist; remove playlist IDs from API (#49609) 2022-06-14 15:32:52 -04:00
plugin_setting_test.go Chore: Remove global bus variable (#50765) 2022-06-14 16:07:41 +02:00
plugin_setting.go Plugins: Fix problematic query (#46777) 2022-03-21 15:42:05 +01:00
quota_test.go Chore: Exclude integration tests from running on test-backend step (#50359) 2022-06-10 11:46:21 -04:00
quota.go Chore: Remove bus (#47511) 2022-04-08 16:15:06 +02:00
session.go Split Create User (#50502) 2022-06-28 14:32:25 +02:00
sqlbuilder_test.go Split Create User (#50502) 2022-06-28 14:32:25 +02:00
sqlbuilder.go Remove unnecesary joins from queries (#43626) 2022-01-04 13:04:02 +01:00
sqlstore_test.go Chore: Exclude integration tests from running on test-backend step (#50359) 2022-06-10 11:46:21 -04:00
sqlstore.go Split Create User (#50502) 2022-06-28 14:32:25 +02:00
sqlstore.goconvey feat(invite): small progress 2015-07-17 14:42:49 +02:00
stats_integration_test.go Chore: Exclude integration tests from running on test-backend step (#50359) 2022-06-10 11:46:21 -04:00
stats_test.go Split Create User (#50502) 2022-06-28 14:32:25 +02:00
stats.go PublicDashboards: collect stats for public dashboards (#50553) 2022-06-23 12:02:57 -03:00
store.go ServiceAccounts: Add Service Account Token last used at date (#51446) 2022-06-28 16:42:40 +02: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: Exclude integration tests from running on test-backend step (#50359) 2022-06-10 11:46:21 -04:00
tags.go Chore: Enable Go linter gocritic (#26224) 2020-07-16 14:39:01 +02:00
team_test.go Service accounts: Add service account to teams (#51536) 2022-07-06 05:34:36 -04:00
team.go Service accounts: Add service account to teams (#51536) 2022-07-06 05:34:36 -04:00
temp_user_test.go Chore: Exclude integration tests from running on test-backend step (#50359) 2022-06-10 11:46:21 -04:00
temp_user.go Chore: Remove bus (#47511) 2022-04-08 16:15:06 +02:00
tls_mysql.go Chore: Fix staticcheck issues (#28854) 2020-11-05 11:57:20 +01:00
transactions_test.go Chore: Exclude integration tests from running on test-backend step (#50359) 2022-06-10 11:46:21 -04:00
transactions.go Chore: Remove global bus variable (#50765) 2022-06-14 16:07:41 +02:00
user_test.go Split Create User (#50502) 2022-06-28 14:32:25 +02:00
user.go ServiceAccounts: Don't create new orgs for service accounts (#51819) 2022-07-07 08:50:38 -04:00