grafana/pkg/services/sqlstore
Eric Leijonmarck 1e8f8dff4b
Auth: Adds validation and ingestion of conflict file (#53014)
* add users-manager command

* add users-manager command

* rename files

* refactor: imports and renaming

* Command: add conflict merge user command

- MergeUser will
	- replace all user_ids from conflicting users to the chosen userId
	- delete users whose user_ids are not the chosen user
- SameIdentification will
	- update chosen user with chosen email,login details
	- delete users whose user_ids are not the chosen user

* refactor: clean up

* refactor: create structure for read, validate, ingest

* feat: ls and generate-file for conflicting users

* remove usagestats

* added back pkg/services/login/authinfoservice/database/stats.go

* Revert "added back pkg/services/login/authinfoservice/database/stats.go"

This reverts commit 2ba6e3c4d6.

* Revert "remove usagestats"

This reverts commit 1e3fa97810.

* cherry pick

* Revert "cherry pick"

This reverts commit 461626c306.

* validation of picked merge user

* fix test

* make lint

* make test run

* tests for ingest working

* clean up and refactored to align with downstream refactoring

* formatting

* refactor: name list instead of ls

* fix: static lint error use trimprefix

* WIP: permissions for validation

* fix: remove unused functions in sqlstore

* fix: remove unused function

* handling of multiple users and resolve discarded users

* fix tests

* fix: bug that did not exclude the blocks

* ioutil is blacklisted

* WIP: validation

* tests for merging a user working

* add latest changes to output print

* refactor: removed conflictEmail and conflictLogin that was not used

* refactor: code clean up, showChanges working

* test and linting fixes

* test and linting fixes

* refactor: removed logging of config and added more info for vlidation command

* refactor: fix order of code

* fix time now

* refactor: no longer need for check casesensitive login/email

* removed unnessecary loop

* refactor: move functions around

* test: working

* docs: add docuemntationf for file

* Add failing test for generating the conflict login block

* Fix regex

* Fix some stuff/tests

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

* add: docs for conflict file

* add: conflict_email, conflict_login fields

* add: conflict_email, conflict_login fields

* WIP

* fix: tests working as intended

* Update pkg/cmd/grafana-cli/commands/conflict_user_command.go

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>

* review comments

* Update pkg/cmd/grafana-cli/commands/conflict_user_command.go

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

* Update pkg/cmd/grafana-cli/commands/conflict_user_command.go

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

* missspelling

* trailing new line

* update to use userimpl store

* remove newline

* remove newline

* refactor: initializing of resolver for conflicts

* fix: test sqlStore

* refactor: removed lines

* refactor: remove TODOs

Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
2022-09-29 14:26:24 +02:00
..
db Chore: Remove GetUserByEmail and GetUserByLogin from sqlstore (#55903) 2022-09-28 13:18:19 +02:00
migrations Glue: Add DB migration & support provisioning for user-defined correlations config (#55560) 2022-09-27 11:08:02 +02:00
migrator Chore: Upgrade Go to 1.19.1 (#54902) 2022-09-12 12:03:49 +02:00
mockstore Chore: Remove GetUserByEmail and GetUserByLogin from sqlstore (#55903) 2022-09-28 13:18:19 +02:00
permissions Move SignedInUser to user service and RoleType and Roles to org (#53445) 2022-08-10 11:56:48 +02:00
searchstore Chore: Upgrade Go to 1.19.1 (#54902) 2022-09-12 12:03:49 +02:00
session Chore: replace xorm by sqlx in dashboardversion service (#53869) 2022-08-25 16:04:16 -05:00
sqlutil Chore: remove xorm from preference (#53803) 2022-08-17 22:07:20 -04:00
database_wrapper.go Logging: Introduce API for contextual logging (#55198) 2022-09-20 18:32:06 +02: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
org_test.go Chore: Remove methods from sqlstore interface (#55802) 2022-09-27 15:33:38 +02:00
org_users_test.go Chore: Remove methods from sqlstore interface (#55802) 2022-09-27 15:33:38 +02:00
org_users.go Auth: Adds validation and ingestion of conflict file (#53014) 2022-09-29 14:26:24 +02:00
org.go Chore: Move updateorg out of sqlstore (#54111) 2022-08-23 12:26:21 -05: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 Storage: limit the number of uploaded files (#50796) 2022-07-18 15:24:39 +04:00
session.go Chore: StoreSplit tag service (#55453) 2022-09-21 08:04:01 -04:00
sqlbuilder_test.go Chore: Move team store implementation to a separate package (#55514) 2022-09-22 19:16:21 +02:00
sqlbuilder.go Chore: Add user service method SetUsingOrg and GetSignedInUserWithCacheCtx (#53343) 2022-08-11 13:28:55 +02:00
sqlstore_metrics_test.go Metrics: Fixed grafana_database_conn_* metrics, and added new go_sql_stats_* metrics as eventual replacement (#54405) 2022-08-31 08:54:32 -04:00
sqlstore_metrics.go Metrics: Fixed grafana_database_conn_* metrics, and added new go_sql_stats_* metrics as eventual replacement (#54405) 2022-08-31 08:54:32 -04:00
sqlstore_test.go Chore: Enable ANSI_QUOTES for Mysql Database (#53277) 2022-08-08 12:14:17 -04:00
sqlstore.go Chore: Remove GetUserByEmail and GetUserByLogin from sqlstore (#55903) 2022-09-28 13:18:19 +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 UserService: use the UserService instead of calling sqlstore directly (#55745) 2022-09-27 07:58:49 -04:00
stats.go Move SignedInUser to user service and RoleType and Roles to org (#53445) 2022-08-10 11:56:48 +02:00
store.go Chore: Remove GetUserByEmail and GetUserByLogin from sqlstore (#55903) 2022-09-28 13:18:19 +02:00
tables.go Began work on real sql schema definitions, and migration engine 2015-01-17 21:40:22 +01:00
time.go Chore: Use TimeNow instead of time.Now in user sql store to make it testable (#54983) 2022-09-09 18:43:14 +02:00
tls_mysql.go Handle ioutil deprecations (#53526) 2022-08-10 15:37:51 +02:00
transactions_test.go Chore: Remove apikey store methods from sqlstore (#53197) 2022-08-03 08:13:05 -04:00
transactions.go Logging: Introduce API for contextual logging (#55198) 2022-09-20 18:32:06 +02:00
user_test.go Chore: Delete UpdateUser, ChangeUserPassword, UpdateLastSeenAt from sqlstore (#55928) 2022-09-28 16:17:09 +02:00
user.go Auth: Adds validation and ingestion of conflict file (#53014) 2022-09-29 14:26:24 +02:00